summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-02-27 14:35:50 (GMT)
committerGregor Jasny <gjasny@googlemail.com>2015-03-18 14:23:53 (GMT)
commit54a5cdbb4c35aa8847d3eb0f7f418fad72563992 (patch)
treeaf0660e63442956707357ddf03d562f01686009d /Tests
parent380db3de00bd74f01781ea93e9ba9cebdea000cc (diff)
downloadCMake-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.txt12
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,