diff options
author | Brad King <brad.king@kitware.com> | 2012-03-19 18:41:43 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-03-19 18:41:43 (GMT) |
commit | bfc8d137c5ff505717f71099f149cfc2682b76ec (patch) | |
tree | 7dde1d714033d64c3808f5c295d883a17faae7a1 /Modules/Platform | |
parent | 572994bd9f8ea77c3101f0b019b693c37b0d502e (diff) | |
parent | 0f4dfa6960e51b7460b91f828932a42d5827467a (diff) | |
download | CMake-bfc8d137c5ff505717f71099f149cfc2682b76ec.zip CMake-bfc8d137c5ff505717f71099f149cfc2682b76ec.tar.gz CMake-bfc8d137c5ff505717f71099f149cfc2682b76ec.tar.bz2 |
Merge topic 'fix-12621-xcode43'
0f4dfa6 CPack: Use real path to PackageMaker to find its version file (#12621)
4693cf8 Xcode: Detect new default locations of Xcode 4.3 bits and pieces (#12621)
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Darwin.cmake | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 867c788..c4b5635 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -6,6 +6,8 @@ SET(APPLE 1) # 8.x == Mac OSX 10.4 (Tiger) # 9.x == Mac OSX 10.5 (Leopard) # 10.x == Mac OSX 10.6 (Snow Leopard) +# 11.x == Mac OSX 10.7 (Lion) +# 12.x == Mac OSX 10.8 (Mountain Lion) STRING(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_SYSTEM_VERSION}") STRING(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\2" DARWIN_MINOR_VERSION "${CMAKE_SYSTEM_VERSION}") @@ -59,19 +61,24 @@ ENDIF(NOT DEFINED CMAKE_INSTALL_NAME_TOOL) # Set the assumed (Pre 10.5 or Default) location of the developer tools SET(OSX_DEVELOPER_ROOT "/Developer") +# Use the xcode-select tool if it's available (Xcode >= 3.0 installations) +FIND_PROGRAM(CMAKE_XCODE_SELECT xcode-select) +IF(CMAKE_XCODE_SELECT) + EXECUTE_PROCESS(COMMAND ${CMAKE_XCODE_SELECT} "-print-path" + OUTPUT_VARIABLE OSX_DEVELOPER_ROOT + OUTPUT_STRIP_TRAILING_WHITESPACE) +ENDIF(CMAKE_XCODE_SELECT) + # Find installed SDKs -FILE(GLOB _CMAKE_OSX_SDKS "${OSX_DEVELOPER_ROOT}/SDKs/*") +# Start with Xcode-4.3+ default SDKs directory +SET(_CMAKE_OSX_SDKS_DIR + "${OSX_DEVELOPER_ROOT}/Platforms/MacOSX.platform/Developer/SDKs") +FILE(GLOB _CMAKE_OSX_SDKS "${_CMAKE_OSX_SDKS_DIR}/*") -# If nothing is found there, then try locating the dev tools based on the xcode-select tool -# (available in Xcode >= 3.0 installations) +# If not present, try pre-4.3 SDKs directory IF(NOT _CMAKE_OSX_SDKS) - FIND_PROGRAM(CMAKE_XCODE_SELECT xcode-select) - IF(CMAKE_XCODE_SELECT) - EXECUTE_PROCESS(COMMAND ${CMAKE_XCODE_SELECT} "-print-path" - OUTPUT_VARIABLE OSX_DEVELOPER_ROOT - OUTPUT_STRIP_TRAILING_WHITESPACE) - FILE(GLOB _CMAKE_OSX_SDKS "${OSX_DEVELOPER_ROOT}/SDKs/*") - ENDIF(CMAKE_XCODE_SELECT) +SET(_CMAKE_OSX_SDKS_DIR "${OSX_DEVELOPER_ROOT}/SDKs") + FILE(GLOB _CMAKE_OSX_SDKS "${_CMAKE_OSX_SDKS_DIR}/*") ENDIF(NOT _CMAKE_OSX_SDKS) EXECUTE_PROCESS(COMMAND sw_vers -productVersion @@ -103,16 +110,16 @@ SET(ENV_SDKROOT "$ENV{SDKROOT}") # Set CMAKE_OSX_SYSROOT_DEFAULT based on _CURRENT_OSX_VERSION, # accounting for the known specially named SDKs. SET(CMAKE_OSX_SYSROOT_DEFAULT - "${OSX_DEVELOPER_ROOT}/SDKs/MacOSX${_CURRENT_OSX_VERSION}.sdk") + "${_CMAKE_OSX_SDKS_DIR}/MacOSX${_CURRENT_OSX_VERSION}.sdk") IF(_CURRENT_OSX_VERSION STREQUAL "10.4") SET(CMAKE_OSX_SYSROOT_DEFAULT - "${OSX_DEVELOPER_ROOT}/SDKs/MacOSX10.4u.sdk") + "${_CMAKE_OSX_SDKS_DIR}/MacOSX10.4u.sdk") ENDIF(_CURRENT_OSX_VERSION STREQUAL "10.4") IF(_CURRENT_OSX_VERSION STREQUAL "10.3") SET(CMAKE_OSX_SYSROOT_DEFAULT - "${OSX_DEVELOPER_ROOT}/SDKs/MacOSX10.3.9.sdk") + "${_CMAKE_OSX_SDKS_DIR}/MacOSX10.3.9.sdk") ENDIF(_CURRENT_OSX_VERSION STREQUAL "10.3") # Use environment or default as initial cache value: |