diff options
author | Brad King <brad.king@kitware.com> | 2015-02-27 14:35:50 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2015-03-18 14:23:53 (GMT) |
commit | 54a5cdbb4c35aa8847d3eb0f7f418fad72563992 (patch) | |
tree | af0660e63442956707357ddf03d562f01686009d /Tests | |
parent | 380db3de00bd74f01781ea93e9ba9cebdea000cc (diff) | |
download | CMake-54a5cdbb4c35aa8847d3eb0f7f418fad72563992.zip CMake-54a5cdbb4c35aa8847d3eb0f7f418fad72563992.tar.gz CMake-54a5cdbb4c35aa8847d3eb0f7f418fad72563992.tar.bz2 |
Tests: Compute Xcode version for any generator on OS X
Store the version in CMake_TEST_XCODE_VERSION for use by tests that work
with any generator on OS X but may depend on the Xcode version providing
the tools.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 40bea51..765fc80 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -172,6 +172,7 @@ if(BUILD_TESTING) ON) mark_as_advanced(CTEST_TEST_CPACK) set(CTEST_TEST_OSX_ARCH 0) + set(CMake_TEST_XCODE_VERSION 0) if(APPLE) execute_process( COMMAND sw_vers -productVersion @@ -185,6 +186,17 @@ if(BUILD_TESTING) else() set(CTEST_TEST_OSX_ARCH 1) endif() + if(XCODE_VERSION) + set(CMake_TEST_XCODE_VERSION "${XCODE_VERSION}") + else() + execute_process( + COMMAND xcodebuild -version + OUTPUT_VARIABLE _version ERROR_VARIABLE _version + ) + if(_version MATCHES "^Xcode ([0-9]+(\\.[0-9]+)*)") + set(CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}") + endif() + endif() endif() # Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value, |