[Cmake-commits] CMake branch, next, updated. v2.8.9-693-gfe49a4f
Brad King
brad.king at kitware.com
Sat Sep 22 07:47:20 EDT 2012
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 fe49a4fcf003a0e53f8c82922e98494c0a6d8283 (commit)
via e7e613efbf1da45a2a9e51d11a4022589d79c642 (commit)
from 9a49bd7107b74669baf8dc6b29985ca4fe0f301c (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=fe49a4fcf003a0e53f8c82922e98494c0a6d8283
commit fe49a4fcf003a0e53f8c82922e98494c0a6d8283
Merge: 9a49bd7 e7e613e
Author: Brad King <brad.king at kitware.com>
AuthorDate: Sat Sep 22 07:47:19 2012 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Sep 22 07:47:19 2012 -0400
Merge topic 'osx-sysroot-cleanup' into next
e7e613e OS X: Teach deployment target sanity check about SDK names
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e7e613efbf1da45a2a9e51d11a4022589d79c642
commit e7e613efbf1da45a2a9e51d11a4022589d79c642
Author: Brad King <brad.king at kitware.com>
AuthorDate: Sat Sep 22 07:41:36 2012 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Sep 22 07:43:43 2012 -0400
OS X: Teach deployment target sanity check about SDK names
Since commit 1786b121 (OS X: Allow CMAKE_OSX_SYSROOT to be a logical SDK
name, 2012-09-21) we support names like "macosx" or "macosx10.7" as the
specified value of CMAKE_OSX_SYSROOT. Extend the SDK name->path
conversion to save the original value and also convert into a temporary
variable for the Xcode generator. Re-implement the deployment target
sanity check to detect the version from the transformed path.
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index 46ea310..a401762 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -148,6 +148,8 @@ set(CMAKE_OSX_SYSROOT "${_CMAKE_OSX_SYSROOT_DEFAULT}" CACHE ${_CMAKE_OSX_SYSROOT
"The product will be built against the headers and libraries located inside the indicated SDK.")
# Transform the cached value to something we can use.
+set(_CMAKE_OSX_SYSROOT_ORIG "${CMAKE_OSX_SYSROOT}")
+set(_CMAKE_OSX_SYSROOT_PATH "")
if(CMAKE_OSX_SYSROOT)
if("x${CMAKE_OSX_SYSROOT}" MATCHES "/")
# This is a path to the SDK. Make sure it exists.
@@ -155,9 +157,11 @@ if(CMAKE_OSX_SYSROOT)
message(WARNING "Ignoring CMAKE_OSX_SYSROOT value:\n ${CMAKE_OSX_SYSROOT}\n"
"because the directory does not exist.")
set(CMAKE_OSX_SYSROOT "")
+ set(_CMAKE_OSX_SYSROOT_ORIG "")
endif()
- elseif(NOT "${CMAKE_GENERATOR}" MATCHES "Xcode")
- # For non-Xcode generators transform the sdk name into a path.
+ set(_CMAKE_OSX_SYSROOT_PATH "${CMAKE_OSX_SYSROOT}")
+ else()
+ # Transform the sdk name into a path.
execute_process(
COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version Path
OUTPUT_VARIABLE _stdout
@@ -166,30 +170,36 @@ if(CMAKE_OSX_SYSROOT)
RESULT_VARIABLE _failed
)
if(NOT _failed AND IS_DIRECTORY "${_stdout}")
- set(CMAKE_OSX_SYSROOT "${_stdout}")
+ set(_CMAKE_OSX_SYSROOT_PATH "${_stdout}")
+ # For non-Xcode generators use the path.
+ if(NOT "${CMAKE_GENERATOR}" MATCHES "Xcode")
+ set(CMAKE_OSX_SYSROOT "${_CMAKE_OSX_SYSROOT_PATH}")
+ endif()
endif()
endif()
endif()
-#----------------------------------------------------------------------------
-function(SanityCheckSDKAndDeployTarget _sdk_path _deploy)
- if(_deploy STREQUAL "")
- return()
- endif()
-
- if(_sdk_path STREQUAL "")
- message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET='${_deploy}' but CMAKE_OSX_SYSROOT is empty... - either set CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to empty")
+# Make sure the combination of SDK and Deployment Target are allowed
+if(CMAKE_OSX_DEPLOYMENT_TARGET)
+ if("${_CMAKE_OSX_SYSROOT_PATH}" MATCHES "^.*/MacOSX([0-9]+\\.[0-9]+)[^/]*\\.sdk")
+ set(_sdk_ver "${CMAKE_MATCH_1}")
+ elseif("${_CMAKE_OSX_SYSROOT_ORIG}" MATCHES "^macosx([0-9]+\\.[0-9]+)$")
+ set(_sdk_ver "${CMAKE_MATCH_1}")
+ else()
+ message(FATAL_ERROR
+ "CMAKE_OSX_DEPLOYMENT_TARGET is '${CMAKE_OSX_DEPLOYMENT_TARGET}' "
+ "but CMAKE_OSX_SYSROOT:\n \"${_CMAKE_OSX_SYSROOT_ORIG}\"\n"
+ "is not set to a MacOSX SDK with a recognized version. "
+ "Either set CMAKE_OSX_SYSROOT to a valid SDK or set "
+ "CMAKE_OSX_DEPLOYMENT_TARGET to empty.")
endif()
-
- string(REGEX REPLACE "(.*MacOSX*)(....)(.*\\.sdk)" "\\2" SDK "${_sdk_path}")
- if(_deploy GREATER "${SDK}")
- message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET (${_deploy}) is greater than CMAKE_OSX_SYSROOT SDK (${_sdk_path}). Please set CMAKE_OSX_DEPLOYMENT_TARGET to ${SDK} or lower")
+ if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER "${_sdk_ver}")
+ message(FATAL_ERROR
+ "CMAKE_OSX_DEPLOYMENT_TARGET (${CMAKE_OSX_DEPLOYMENT_TARGET}) "
+ "is greater than CMAKE_OSX_SYSROOT SDK:\n ${_CMAKE_OSX_SYSROOT_ORIG}\n"
+ "Please set CMAKE_OSX_DEPLOYMENT_TARGET to ${_sdk_ver} or lower.")
endif()
-endfunction()
-#----------------------------------------------------------------------------
-
-# Make sure the combination of SDK and Deployment Target are allowed
-SanityCheckSDKAndDeployTarget("${CMAKE_OSX_SYSROOT}" "${CMAKE_OSX_DEPLOYMENT_TARGET}")
+endif()
if("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
-----------------------------------------------------------------------
Summary of changes:
Modules/Platform/Darwin.cmake | 50 ++++++++++++++++++++++++----------------
1 files changed, 30 insertions(+), 20 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list