2016-09-27 19:01:08 +00:00
|
|
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
|
|
|
|
2018-10-22 14:31:08 +00:00
|
|
|
#[=======================================================================[.rst:
|
|
|
|
CMakeFindFrameworks
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
helper module to find OSX frameworks
|
|
|
|
|
|
|
|
This module reads hints about search locations from variables::
|
|
|
|
|
|
|
|
CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS - Extra directories
|
|
|
|
#]=======================================================================]
|
2005-12-14 18:51:08 +00:00
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
|
|
|
|
set(CMAKE_FIND_FRAMEWORKS_INCLUDED 1)
|
|
|
|
macro(CMAKE_FIND_FRAMEWORKS fwk)
|
|
|
|
set(${fwk}_FRAMEWORKS)
|
|
|
|
if(APPLE)
|
2020-03-11 16:54:26 +00:00
|
|
|
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)
|
2012-08-13 17:47:32 +00:00
|
|
|
if(EXISTS ${dir})
|
|
|
|
set(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
|
2012-08-13 17:50:14 +00:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
endif()
|