diff options
author | Brad King <brad.king@kitware.com> | 2020-12-10 11:57:49 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-12-10 11:57:53 (GMT) |
commit | 020e1e2031ae05844144b64b9ade649479946082 (patch) | |
tree | 88916bb441537e84b0471e8ec01743e02bdd0997 /Tests | |
parent | 9f66eb74a5edbb9480614aecd1e2c8cb915a6bd8 (diff) | |
parent | 55193c8013fbdf9a9bb211bb27833007a189a44c (diff) | |
download | CMake-020e1e2031ae05844144b64b9ade649479946082.zip CMake-020e1e2031ae05844144b64b9ade649479946082.tar.gz CMake-020e1e2031ae05844144b64b9ade649479946082.tar.bz2 |
Merge topic 'test-macos-version' into release-3.19
55193c8013 ci: Hard-code XCTest deployment target to 10.15
40877903ac Tests: Remove outdated exclusion of tests on OS X 10.3
c404d7f221 Tests: Add cache entry to control XCTest deployment target
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5593
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} |