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:54 (GMT) |
commit | 419adf0eef5888639a95465459ff8297e414fae0 (patch) | |
tree | af527d6818ef4b7e1299b8e5e0ca9a0568789cb8 /Tests | |
parent | ea77dbcaf874a64d0aba0f36c7404fc26dc87deb (diff) | |
parent | 55193c8013fbdf9a9bb211bb27833007a189a44c (diff) | |
download | CMake-419adf0eef5888639a95465459ff8297e414fae0.zip CMake-419adf0eef5888639a95465459ff8297e414fae0.tar.gz CMake-419adf0eef5888639a95465459ff8297e414fae0.tar.bz2 |
Merge topic 'test-macos-version'
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 e0be694..14095dd 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -299,18 +299,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() @@ -1832,11 +1821,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} |