[cmake-developers] [PATCH] Allow custom osx framework locations.

David Keller david.keller at litchis.fr
Sat Jul 30 10:48:53 EDT 2016


This allows non-standard locations to be searched, e.g. brew, port.

Signed-off-by: David Keller <david.keller at litchis.fr>
---
 Modules/CMakeFindFrameworks.cmake | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Modules/CMakeFindFrameworks.cmake b/Modules/CMakeFindFrameworks.cmake
index 6a8bcd4..80eb003 100644
--- a/Modules/CMakeFindFrameworks.cmake
+++ b/Modules/CMakeFindFrameworks.cmake
@@ -3,6 +3,10 @@
 # -------------------
 #
 # helper module to find OSX frameworks
+#
+# This module reads hints about search locations from variables::
+#
+#   CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS - Extra directories
 
 #=============================================================================
 # Copyright 2003-2009 Kitware, Inc.
@@ -24,9 +28,11 @@ if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
     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)
+          /Network/Library/Frameworks/${fwk}.framework
+          ${CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS})
         if(EXISTS ${dir})
           set(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
         endif()
-- 
2.7.4 (Apple Git-66)



More information about the cmake-developers mailing list