Imported Upstream version 2.8.10.2
[platform/upstream/cmake.git] / Modules / CMakeFindFrameworks.cmake
1 # - helper module to find OSX frameworks
2
3 #=============================================================================
4 # Copyright 2003-2009 Kitware, Inc.
5 #
6 # Distributed under the OSI-approved BSD License (the "License");
7 # see accompanying file Copyright.txt for details.
8 #
9 # This software is distributed WITHOUT ANY WARRANTY; without even the
10 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 # See the License for more information.
12 #=============================================================================
13 # (To distribute this file outside of CMake, substitute the full
14 #  License text for the above reference.)
15
16 if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
17   set(CMAKE_FIND_FRAMEWORKS_INCLUDED 1)
18   macro(CMAKE_FIND_FRAMEWORKS fwk)
19     set(${fwk}_FRAMEWORKS)
20     if(APPLE)
21       foreach(dir
22           ~/Library/Frameworks/${fwk}.framework
23           /Library/Frameworks/${fwk}.framework
24           /System/Library/Frameworks/${fwk}.framework
25           /Network/Library/Frameworks/${fwk}.framework)
26         if(EXISTS ${dir})
27           set(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
28         endif()
29       endforeach()
30     endif()
31   endmacro()
32 endif()