CMakeFindFrameworks.cmake 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #[=======================================================================[.rst:
  4. CMakeFindFrameworks
  5. -------------------
  6. helper module to find OSX frameworks
  7. This module reads hints about search locations from variables::
  8. CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS - Extra directories
  9. #]=======================================================================]
  10. if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
  11. set(CMAKE_FIND_FRAMEWORKS_INCLUDED 1)
  12. macro(CMAKE_FIND_FRAMEWORKS fwk)
  13. set(${fwk}_FRAMEWORKS)
  14. if(APPLE)
  15. foreach(dir
  16. ~/Library/Frameworks/${fwk}.framework
  17. /usr/local/Frameworks/${fwk}.framework
  18. /Library/Frameworks/${fwk}.framework
  19. /System/Library/Frameworks/${fwk}.framework
  20. /Network/Library/Frameworks/${fwk}.framework
  21. ${CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS})
  22. if(EXISTS ${dir})
  23. set(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
  24. endif()
  25. endforeach()
  26. endif()
  27. endmacro()
  28. endif()