2 # This CMake file contains two macros to assist with searching for OSG
3 # libraries and nodekits. Please see FindOpenSceneGraph.cmake for full
7 #=============================================================================
8 # Copyright 2009 Kitware, Inc.
9 # Copyright 2009-2012 Philip Lowman <philip@yhbt.com>
11 # Distributed under the OSI-approved BSD License (the "License");
12 # see accompanying file Copyright.txt for details.
14 # This software is distributed WITHOUT ANY WARRANTY; without even the
15 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 # See the License for more information.
17 #=============================================================================
18 # (To distribute this file outside of CMake, substitute the full
19 # License text for the above reference.)
24 function(OSG_FIND_PATH module header)
25 string(TOUPPER ${module} module_uc)
27 # Try the user's environment request before anything else.
28 find_path(${module_uc}_INCLUDE_DIR ${header}
39 /opt/local # DarwinPorts
50 function(OSG_FIND_LIBRARY module library)
51 string(TOUPPER ${module} module_uc)
53 find_library(${module_uc}_LIBRARY
65 /opt/local # DarwinPorts
71 find_library(${module_uc}_LIBRARY_DEBUG
83 /opt/local # DarwinPorts
89 if(NOT ${module_uc}_LIBRARY_DEBUG)
90 # They don't have a debug library
91 set(${module_uc}_LIBRARY_DEBUG ${${module_uc}_LIBRARY} PARENT_SCOPE)
92 set(${module_uc}_LIBRARIES ${${module_uc}_LIBRARY} PARENT_SCOPE)
94 # They really have a FOO_LIBRARY_DEBUG
95 set(${module_uc}_LIBRARIES
96 optimized ${${module_uc}_LIBRARY}
97 debug ${${module_uc}_LIBRARY_DEBUG}
104 # OSG_MARK_AS_ADVANCED
105 # Just a convenience function for calling MARK_AS_ADVANCED
107 function(OSG_MARK_AS_ADVANCED _module)
108 string(TOUPPER ${_module} _module_UC)
109 mark_as_advanced(${_module_UC}_INCLUDE_DIR)
110 mark_as_advanced(${_module_UC}_LIBRARY)
111 mark_as_advanced(${_module_UC}_LIBRARY_DEBUG)