summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-04-06 10:47:02 -0400
committerDavid Cole <david.cole@kitware.com>2012-04-06 11:14:37 -0400
commitd9edf46760a39d230836a7b99fb4ac33d466c337 (patch)
treeb0743325fdea9dc8a41b016828b935b07feba98f
parent98b9a7f6ffa733a6fdcf06ede839932b770dc7c6 (diff)
downloadcmake-d9edf46760a39d230836a7b99fb4ac33d466c337.tar.gz
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.
-rw-r--r--Modules/Platform/Darwin.cmake18
1 files changed, 15 insertions, 3 deletions
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index b8357d1273..ee1fc0e478 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