diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 4938681..02759d1 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -301,18 +301,7 @@ if(BUILD_TESTING) set(CTEST_TEST_OSX_ARCH 0) set(CMake_TEST_XCODE_VERSION 0) if(APPLE) - execute_process( - COMMAND sw_vers -productVersion - OUTPUT_VARIABLE OSX_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if(OSX_VERSION VERSION_LESS 10.4) - message(STATUS "Forcing CTEST_TEST_CPACK=OFF on OSX < 10.4") - message(STATUS "OSX_VERSION='${OSX_VERSION}'") - set(CTEST_TEST_CPACK OFF) - else() - set(CTEST_TEST_OSX_ARCH 1) - endif() + set(CTEST_TEST_OSX_ARCH 1) if(XCODE_VERSION) set(CMake_TEST_XCODE_VERSION "${XCODE_VERSION}") else() @@ -1833,11 +1822,22 @@ if(BUILD_TESTING) ) endif() - if(CMake_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 5 - AND OSX_VERSION MATCHES "^([0-9]+\\.[0-9]+)") - set(XCTest_CTEST_OPTIONS --build-config $<CONFIGURATION>) - set(XCTest_BUILD_OPTIONS -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_MATCH_1} -DCMAKE_OSX_SYSROOT=macosx) - ADD_TEST_MACRO(XCTest ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> -V) + if(CMake_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 5) + if(NOT CMake_TEST_XCTest_DEPLOYMENT_TARGET) + execute_process( + COMMAND sw_vers -productVersion + OUTPUT_VARIABLE OSX_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(OSX_VERSION MATCHES "^([0-9]+\\.[0-9]+)") + set(CMake_TEST_XCTest_DEPLOYMENT_TARGET "${CMAKE_MATCH_1}") + endif() + endif() + if(CMake_TEST_XCTest_DEPLOYMENT_TARGET) + set(XCTest_CTEST_OPTIONS --build-config $<CONFIGURATION>) + set(XCTest_BUILD_OPTIONS -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMake_TEST_XCTest_DEPLOYMENT_TARGET} -DCMAKE_OSX_SYSROOT=macosx) + ADD_TEST_MACRO(XCTest ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> -V) + endif() endif() add_test(linkorder1 ${CMAKE_CTEST_COMMAND} |