summaryrefslogtreecommitdiffstats
path: root/Tests/BuildDepends
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/BuildDepends')
-rw-r--r--Tests/BuildDepends/Project/CMakeLists.txt20
1 files changed, 18 insertions, 2 deletions
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
index f03c238..a977884 100644
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -1,11 +1,27 @@
cmake_minimum_required(VERSION 2.6)
project(testRebuild)
+
+function(test_for_xcode4 result_var)
+ set(${result_var} 0 PARENT_SCOPE)
+ if(APPLE)
+ execute_process(COMMAND xcodebuild -version
+ OUTPUT_VARIABLE ov RESULT_VARIABLE rv
+ )
+ if("${rv}" STREQUAL "0")
+ if(ov MATCHES "^Xcode 4.[0-9].*$")
+ set(${result_var} 1 PARENT_SCOPE)
+ endif()
+ endif()
+ endif()
+endfunction()
+
if(APPLE)
# only use multi-arch if the sysroot exists on this machine
if(EXISTS "${CMAKE_OSX_SYSROOT}")
set(CMAKE_OSX_ARCHITECTURES "ppc;i386")
- if(NOT "${DARWIN_MAJOR_VERSION}.${DARWIN_MINOR_VERSION}" VERSION_LESS 10.0)
- # Snow Leopard or later, use modern architectures as defaults
+ test_for_xcode4(is_xcode4)
+ if(is_xcode4)
+ # Xcode 4, use modern architectures as defaults
# Arch 'ppc' no longer works: tools no longer available starting with Xcode 4
set(CMAKE_OSX_ARCHITECTURES i386 x86_64)
endif()