diff options
author | Brad King <brad.king@kitware.com> | 2012-09-21 18:25:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-09-21 18:45:54 (GMT) |
commit | 2690738458725f2c52afccd99ee744a9b92e30ed (patch) | |
tree | f97e8dfb513927cc5956fab4c6b3514dae0ef630 /Modules/Platform/Darwin.cmake | |
parent | 7995722e919c66ff3aad7de73d489bf838af5426 (diff) | |
download | CMake-2690738458725f2c52afccd99ee744a9b92e30ed.zip CMake-2690738458725f2c52afccd99ee744a9b92e30ed.tar.gz CMake-2690738458725f2c52afccd99ee744a9b92e30ed.tar.bz2 |
OS X: If CMAKE_OSX_SYSROOT is already set do not compute default
The default computation logic is non-trivial. Do not bother with it if
the value is already known.
Diffstat (limited to 'Modules/Platform/Darwin.cmake')
-rw-r--r-- | Modules/Platform/Darwin.cmake | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index f592085..90d34ca 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -99,10 +99,12 @@ endif() #---------------------------------------------------------------------------- # CMAKE_OSX_SYSROOT -# 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 - (NOT "x$ENV{SDKROOT}" MATCHES "/" OR IS_DIRECTORY "$ENV{SDKROOT}")) +if(CMAKE_OSX_SYSROOT) + # Use the existing value without further computation to choose a default. + set(_CMAKE_OSX_SYSROOT_DEFAULT "${CMAKE_OSX_SYSROOT}") +elseif(NOT "x$ENV{SDKROOT}" STREQUAL "x" AND + (NOT "x$ENV{SDKROOT}" MATCHES "/" OR IS_DIRECTORY "$ENV{SDKROOT}")) + # Use the value of SDKROOT from the environment. set(_CMAKE_OSX_SYSROOT_DEFAULT "$ENV{SDKROOT}") else() # Find installed SDKs in either Xcode-4.3+ or pre-4.3 SDKs directory. |