Commit c404d7f2 authored by Brad King's avatar Brad King
Browse files

Tests: Add cache entry to control XCTest deployment target

parent 8a3ecb48
......@@ -1833,11 +1833,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}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment