From 98b9a7f6ffa733a6fdcf06ede839932b770dc7c6 Mon Sep 17 00:00:00 2001 From: Kashif Rasul Date: Mon, 26 Mar 2012 09:24:04 -0400 Subject: OS X: Use OSX_DEVELOPER_ROOT for app search path (#13066) Since commit 4693cf84 (Xcode: Detect new default locations of Xcode 4.3 bits and pieces) Darwin.cmake detects the developer application directory instead of hard-coding /Developer. Replace the hard-coded path in CMAKE_SYSTEM_APPBUNDLE_PATH using the computed result. --- Modules/Platform/Darwin.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index c4b5635..b8357d1 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -242,7 +242,7 @@ SET(CMAKE_FIND_APPBUNDLE FIRST) SET(CMAKE_SYSTEM_APPBUNDLE_PATH ~/Applications /Applications - /Developer/Applications) + ${OSX_DEVELOPER_ROOT}/Applications) INCLUDE(Platform/UnixPaths) LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH -- cgit v0.12 From d9edf46760a39d230836a7b99fb4ac33d466c337 Mon Sep 17 00:00:00 2001 From: David Cole Date: Fri, 6 Apr 2012 10:47:02 -0400 Subject: OS X: Use correct extra path when searching for applicaton bundles (#13066) The parent commit added a search path relative to OSX_DEVELOPER_ROOT. But with Xcode 4.3 the nested Applications folder is in a different relative location compared to that root. This commit makes the intent of the previous commit work with older and newer Xcode directory layouts. Furthermore, it only adds paths that exist to the search path. --- Modules/Platform/Darwin.cmake | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index b8357d1..ee1fc0e 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -239,10 +239,22 @@ SET(CMAKE_SYSTEM_FRAMEWORK_PATH # default to searching for application bundles first SET(CMAKE_FIND_APPBUNDLE FIRST) # set up the default search directories for application bundles +SET(_apps_paths) +FOREACH(_path + "~/Applications" + "/Applications" + "${OSX_DEVELOPER_ROOT}/../Applications" # Xcode 4.3+ + "${OSX_DEVELOPER_ROOT}/Applications" # pre-4.3 + ) + GET_FILENAME_COMPONENT(_apps "${_path}" ABSOLUTE) + IF(EXISTS "${_apps}") + LIST(APPEND _apps_paths "${_apps}") + ENDIF() +ENDFOREACH() +LIST(REMOVE_DUPLICATES _apps_paths) SET(CMAKE_SYSTEM_APPBUNDLE_PATH - ~/Applications - /Applications - ${OSX_DEVELOPER_ROOT}/Applications) + ${_apps_paths}) +UNSET(_apps_paths) INCLUDE(Platform/UnixPaths) LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH -- cgit v0.12 From 6190415436bd00de65cd702e5e5e74061d0c8462 Mon Sep 17 00:00:00 2001 From: David Cole Date: Fri, 6 Apr 2012 11:15:39 -0400 Subject: OS X: Mark find_program results as advanced Avoid cluttering the gui with variables nearly nobody needs to see. --- Modules/Platform/Darwin.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index ee1fc0e..f9d37c3 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -56,6 +56,7 @@ SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a") # hardcode CMAKE_INSTALL_NAME_TOOL here to install_name_tool, so it behaves as it did before, Alex IF(NOT DEFINED CMAKE_INSTALL_NAME_TOOL) FIND_PROGRAM(CMAKE_INSTALL_NAME_TOOL install_name_tool) + MARK_AS_ADVANCED(CMAKE_INSTALL_NAME_TOOL) ENDIF(NOT DEFINED CMAKE_INSTALL_NAME_TOOL) # Set the assumed (Pre 10.5 or Default) location of the developer tools @@ -63,6 +64,7 @@ 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) +MARK_AS_ADVANCED(CMAKE_XCODE_SELECT) IF(CMAKE_XCODE_SELECT) EXECUTE_PROCESS(COMMAND ${CMAKE_XCODE_SELECT} "-print-path" OUTPUT_VARIABLE OSX_DEVELOPER_ROOT -- cgit v0.12