summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-08-02 18:00:13 (GMT)
committerBrad King <brad.king@kitware.com>2013-08-02 18:05:00 (GMT)
commit95f78e08febc541ec9f1d1b57e57c1c639c2d50a (patch)
tree599e50c5d398263291c5296d56b497894fb63d86 /Modules/Platform
parentb341bf2178e3923636735ae1df53a33e5857df7d (diff)
downloadCMake-95f78e08febc541ec9f1d1b57e57c1c639c2d50a.zip
CMake-95f78e08febc541ec9f1d1b57e57c1c639c2d50a.tar.gz
CMake-95f78e08febc541ec9f1d1b57e57c1c639c2d50a.tar.bz2
OS X: Search for SDK based on deployment target (#14324)
When available, use CMAKE_OSX_DEPLOYMENT_TARGET instead of the host OS X version to select the default SDK. This makes sense because one should use the SDK matching the deployment target. Suggested-by: John Ralls <jralls@ceridwen.us>
Diffstat (limited to 'Modules/Platform')
-rw-r--r--Modules/Platform/Darwin.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index f0652b9..865cc8e 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -132,7 +132,11 @@ elseif("${CMAKE_GENERATOR}" MATCHES Xcode
# specially named SDKs.
set(_CMAKE_OSX_SDKS_VER_SUFFIX_10.4 "u")
set(_CMAKE_OSX_SDKS_VER_SUFFIX_10.3 ".9")
- set(_CMAKE_OSX_SDKS_VER ${_CURRENT_OSX_VERSION}${_CMAKE_OSX_SDKS_VER_SUFFIX_${_CURRENT_OSX_VERSION}})
+ if(CMAKE_OSX_DEPLOYMENT_TARGET)
+ set(_CMAKE_OSX_SDKS_VER ${CMAKE_OSX_DEPLOYMENT_TARGET}${_CMAKE_OSX_SDKS_VER_SUFFIX_${CMAKE_OSX_DEPLOYMENT_TARGET}})
+ else()
+ set(_CMAKE_OSX_SDKS_VER ${_CURRENT_OSX_VERSION}${_CMAKE_OSX_SDKS_VER_SUFFIX_${_CURRENT_OSX_VERSION}})
+ endif()
set(_CMAKE_OSX_SYSROOT_DEFAULT
"${_CMAKE_OSX_SDKS_DIR}/MacOSX${_CMAKE_OSX_SDKS_VER}.sdk")
else()