[Cmake-commits] CMake branch, next, updated. v2.8.4-1888-g7af2a19
David Cole
david.cole at kitware.com
Mon Jul 18 10:05:45 EDT 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 7af2a19b4024cb0ed17a34182f6de14fd8a66a13 (commit)
via 5f7acc8d75d736905d9f54badebc80ad196e8877 (commit)
from c77331b48476b0421b9ff76d1681b908208c6b06 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7af2a19b4024cb0ed17a34182f6de14fd8a66a13
commit 7af2a19b4024cb0ed17a34182f6de14fd8a66a13
Merge: c77331b 5f7acc8
Author: David Cole <david.cole at kitware.com>
AuthorDate: Mon Jul 18 10:05:43 2011 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jul 18 10:05:43 2011 -0400
Merge topic 'fix-tests-failing-with-Xcode4' into next
5f7acc8 Base architecture choice logic on Xcode version
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f7acc8d75d736905d9f54badebc80ad196e8877
commit 5f7acc8d75d736905d9f54badebc80ad196e8877
Author: David Cole <david.cole at kitware.com>
AuthorDate: Mon Jul 18 09:59:58 2011 -0400
Commit: David Cole <david.cole at kitware.com>
CommitDate: Mon Jul 18 09:59:58 2011 -0400
Base architecture choice logic on Xcode version
Not on Darwin version.
diff --git a/Tests/Architecture/CMakeLists.txt b/Tests/Architecture/CMakeLists.txt
index db84ea9..c210727 100644
--- a/Tests/Architecture/CMakeLists.txt
+++ b/Tests/Architecture/CMakeLists.txt
@@ -3,8 +3,24 @@ project(Architecture C)
set(archs i386 ppc)
-if(NOT "${DARWIN_MAJOR_VERSION}.${DARWIN_MINOR_VERSION}" VERSION_LESS 10.0)
- # Snow Leopard or later, use modern architectures as defaults
+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()
+
+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(archs i386 x86_64)
endif()
@@ -24,11 +40,9 @@ list(LENGTH archs archs_len)
if(archs_len GREATER 1)
list(GET archs 0 arch0)
list(GET archs 1 arch1)
-else()
- set(arch0 ${archs})
- set(arch1 ${archs})
endif()
+message("is_xcode4='${is_xcode4}'")
message("archs='${archs}'")
message("arch0='${arch0}'")
message("arch1='${arch1}'")
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()
-----------------------------------------------------------------------
Summary of changes:
Tests/Architecture/CMakeLists.txt | 24 +++++++++++++++++++-----
Tests/BuildDepends/Project/CMakeLists.txt | 20 ++++++++++++++++++--
2 files changed, 37 insertions(+), 7 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list