diff options
author | Brad King <brad.king@kitware.com> | 2013-08-02 18:00:13 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-08-02 18:05:00 (GMT) |
commit | 95f78e08febc541ec9f1d1b57e57c1c639c2d50a (patch) | |
tree | 599e50c5d398263291c5296d56b497894fb63d86 /Modules/Platform | |
parent | b341bf2178e3923636735ae1df53a33e5857df7d (diff) | |
download | CMake-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.cmake | 6 |
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() |