]> git.mxchange.org Git - simgear.git/commitdiff
Fix for CMake 2.6
authorThomas Geymayer <tomgey@gmail.com>
Thu, 8 May 2014 09:17:06 +0000 (11:17 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Thu, 8 May 2014 09:17:28 +0000 (11:17 +0200)
No named arguments for add_test in CMake 2.6.

CMakeModules/BoostTestTargets.cmake

index c3d5dbe1492973cbe82c72e844d7a9931cb260bf..a74a55040d28a257679f775d79287d1e31c6c95f 100644 (file)
@@ -41,7 +41,7 @@ if(__add_boost_test)
 endif()
 set(__add_boost_test YES)
 
-set(BOOST_TEST_TARGET_PREFIX "boosttest")
+set(BOOST_TEST_TARGET_PREFIX "test")
 
 if(NOT Boost_FOUND)
        find_package(Boost 1.34.0 QUIET)
@@ -93,20 +93,6 @@ function(add_boost_test _name)
        if(NOT BUILD_TESTING)
                return()
        endif()
-# TODO check if 2.6 is enough
-#      if("${CMAKE_VERSION}" VERSION_LESS "2.8.0")
-#              if(NOT "${_boost_test_cmakever_pestered}x" EQUAL "${CMAKE_VERSION}x")
-#                      message(STATUS
-#                              "Not adding boost::test targets - CMake 2.8.0 or newer required, using ${CMAKE_VERSION}")
-#                      set(_boost_test_cmakever_pestered
-#                              "${CMAKE_VERSION}"
-#                              CACHE
-#                              INTERNAL
-#                              ""
-#                              FORCE)
-#              endif()
-#              return()
-#      endif()
 
        # parse arguments
        set(_nowhere)
@@ -239,12 +225,10 @@ function(add_boost_test _name)
 
                if(TESTS AND ( "${Boost_VERSION}" VERSION_GREATER "103799" ))
                        foreach(_test ${TESTS})
-                               add_test(NAME
+                               add_test(
                                        ${_name}-${_test}
-                                       COMMAND
-                                       ${_test_command}
-                                       --run_test=${_test}
-                                       ${Boost_TEST_FLAGS})
+                                       ${_test_command} --run_test=${_test} ${Boost_TEST_FLAGS}
+                               )
                                if(FAIL_REGULAR_EXPRESSION)
                                        set_tests_properties(${_name}-${_test}
                                                PROPERTIES
@@ -253,13 +237,12 @@ function(add_boost_test _name)
                                endif()
                        endforeach()
                else()
-                       add_test(NAME
+                       add_test(
                                ${_name}-boost_test
-                               COMMAND
-                               ${_test_command}
-                               ${Boost_TEST_FLAGS})
+                               ${_test_command} ${Boost_TEST_FLAGS}
+                       )
                        if(FAIL_REGULAR_EXPRESSION)
-                               set_tests_properties(${_name}-${_test}
+                               set_tests_properties(${_name}-boost_test
                                        PROPERTIES
                                        FAIL_REGULAR_EXPRESSION
                                        "${FAIL_REGULAR_EXPRESSION}")