mirror of
https://github.com/reactos/CMake.git
synced 2024-11-23 03:29:47 +00:00
CMakeFindFrameworks: Search CMAKE_FRAMEWORK_PATH
This commit is contained in:
parent
c7c6e103d1
commit
c841d43d70
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user