summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-03-12 12:24:17 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-03-12 12:24:22 (GMT)
commit0683f2e9e459ec807de973f34a9ade1380e7e79e (patch)
treeb98b9c330416fce359830974eb05d11de31076fc /Modules
parent1e0b0621826061f64696ab045a47d66162532911 (diff)
parentc841d43d70036830c9fe16a6dbf1f28acf49d7e3 (diff)
downloadCMake-0683f2e9e459ec807de973f34a9ade1380e7e79e.zip
CMake-0683f2e9e459ec807de973f34a9ade1380e7e79e.tar.gz
CMake-0683f2e9e459ec807de973f34a9ade1380e7e79e.tar.bz2
Merge topic 'CMakeFindFrameworks-CMAKE_FRAMEWORK_PATH'
c841d43d70 CMakeFindFrameworks: Search CMAKE_FRAMEWORK_PATH Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4461
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeFindFrameworks.cmake26
1 files changed, 19 insertions, 7 deletions
diff --git a/Modules/CMakeFindFrameworks.cmake b/Modules/CMakeFindFrameworks.cmake
index 06c05fb..8906f48 100644
--- a/Modules/CMakeFindFrameworks.cmake
+++ b/Modules/CMakeFindFrameworks.cmake
@@ -17,13 +17,25 @@ if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
macro(CMAKE_FIND_FRAMEWORKS fwk)
set(${fwk}_FRAMEWORKS)
if(APPLE)
- foreach(dir
- ~/Library/Frameworks/${fwk}.framework
- /usr/local/Frameworks/${fwk}.framework
- /Library/Frameworks/${fwk}.framework
- /System/Library/Frameworks/${fwk}.framework
- /Network/Library/Frameworks/${fwk}.framework
- ${CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS})
+ file(TO_CMAKE_PATH "$ENV{CMAKE_FRAMEWORK_PATH}" _cmff_CMAKE_FRAMEWORK_PATH)
+ set(_cmff_search_paths
+ ${CMAKE_FRAMEWORK_PATH}
+ ${_cmff_CMAKE_FRAMEWORK_PATH}
+ ~/Library/Frameworks
+ /usr/local/Frameworks
+ /Library/Frameworks
+ /System/Library/Frameworks
+ /Network/Library/Frameworks
+ ${CMAKE_SYSTEM_FRAMEWORK_PATH})
+
+ # For backwards compatibility reasons,
+ # CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS includes ${fwk}.framework
+ list(TRANSFORM _cmff_search_paths APPEND /${fwk}.framework)
+ list(APPEND _cmff_search_paths ${CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS})
+
+ list(REMOVE_DUPLICATES _cmff_search_paths)
+
+ foreach(dir IN LISTS _cmff_search_paths)
if(EXISTS ${dir})
set(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
endif()