[Cmake-commits] CMake branch, next, updated. v2.8.9-685-gd2ab62f
Brad King
brad.king at kitware.com
Fri Sep 21 13:32:37 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 d2ab62f12da624b0ca7f476a519d0db369a8b962 (commit)
via 1786b121b40ca0a50a57f44e5e2edef7b9d270ed (commit)
from 1d2dc553d3cd139bd64a0e31d2d031ae8b5ff554 (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=d2ab62f12da624b0ca7f476a519d0db369a8b962
commit d2ab62f12da624b0ca7f476a519d0db369a8b962
Merge: 1d2dc55 1786b12
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 21 13:32:36 2012 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Sep 21 13:32:36 2012 -0400
Merge topic 'osx-sysroot-cleanup' into next
1786b12 OS X: Allow CMAKE_OSX_SYSROOT to be a logical SDK name
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1786b121b40ca0a50a57f44e5e2edef7b9d270ed
commit 1786b121b40ca0a50a57f44e5e2edef7b9d270ed
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 21 13:18:49 2012 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 21 13:31:46 2012 -0400
OS X: Allow CMAKE_OSX_SYSROOT to be a logical SDK name
Xcode supports SDKROOT values that just name an SDK rather than
specifying the full path to it. Recognize these values and handle them.
For Xcode we just put the value directly in the generated project file.
For Makefile generators we ask xcodebuild to provide the full path to
the named SDK.
Suggested-by: Jason DiCioccio <jd at ods.org>
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index b160854..56f340d 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -97,7 +97,8 @@ endif()
# Environment variable set by the user overrides our default.
# Use the same environment variable that Xcode uses.
-if(NOT "x$ENV{SDKROOT}" STREQUAL "x" AND EXISTS "$ENV{SDKROOT}")
+if(NOT "x$ENV{SDKROOT}" STREQUAL "x" AND
+ (NOT "x$ENV{SDKROOT}" MATCHES "/" OR IS_DIRECTORY "$ENV{SDKROOT}"))
set(_CMAKE_OSX_SYSROOT_DEFAULT "$ENV{SDKROOT}")
else()
# Find installed SDKs in either Xcode-4.3+ or pre-4.3 SDKs directory.
@@ -127,9 +128,41 @@ else()
endif()
# Set cache variable - end user may change this during ccmake or cmake-gui configure.
-set(CMAKE_OSX_SYSROOT "${_CMAKE_OSX_SYSROOT_DEFAULT}" CACHE PATH
+# Choose the type based on the current value.
+set(_CMAKE_OSX_SYSROOT_TYPE STRING)
+foreach(v CMAKE_OSX_SYSROOT _CMAKE_OSX_SYSROOT_DEFAULT)
+ if("x${${v}}" MATCHES "/")
+ set(_CMAKE_OSX_SYSROOT_TYPE PATH)
+ break()
+ endif()
+endforeach()
+set(CMAKE_OSX_SYSROOT "${_CMAKE_OSX_SYSROOT_DEFAULT}" CACHE ${_CMAKE_OSX_SYSROOT_TYPE}
"The product will be built against the headers and libraries located inside the indicated SDK.")
+# Transform the cached value to something we can use.
+if(CMAKE_OSX_SYSROOT)
+ if("x${CMAKE_OSX_SYSROOT}" MATCHES "/")
+ # This is a path to the SDK. Make sure it exists.
+ if(NOT IS_DIRECTORY "${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 "")
+ endif()
+ elseif(NOT "${CMAKE_GENERATOR}" MATCHES "Xcode")
+ # For non-Xcode generators transform the sdk name into a path.
+ execute_process(
+ COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version Path
+ OUTPUT_VARIABLE _stdout
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE _stderr
+ RESULT_VARIABLE _failed
+ )
+ if(NOT _failed AND IS_DIRECTORY "${_stdout}")
+ set(CMAKE_OSX_SYSROOT "${_stdout}")
+ endif()
+ endif()
+endif()
+
#----------------------------------------------------------------------------
function(SanityCheckSDKAndDeployTarget _sdk_path _deploy)
if(_deploy STREQUAL "")
-----------------------------------------------------------------------
Summary of changes:
Modules/Platform/Darwin.cmake | 37 +++++++++++++++++++++++++++++++++++--
1 files changed, 35 insertions(+), 2 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list