From: Thomas Geymayer Date: Thu, 8 May 2014 09:17:06 +0000 (+0200) Subject: Fix for CMake 2.6 X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=55f18574aa5a99806751646ac14112bb46aad8f3;p=simgear.git Fix for CMake 2.6 No named arguments for add_test in CMake 2.6. --- diff --git a/CMakeModules/BoostTestTargets.cmake b/CMakeModules/BoostTestTargets.cmake index c3d5dbe1..a74a5504 100644 --- a/CMakeModules/BoostTestTargets.cmake +++ b/CMakeModules/BoostTestTargets.cmake @@ -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}")