2 # This CMake file contains two macros to assist with searching for OSG
3 # libraries and nodekits.
9 function(OSG_FIND_PATH module header)
10 string(TOUPPER ${module} module_uc)
12 # Try the user's environment request before anything else.
13 find_path(${module_uc}_INCLUDE_DIR ${header}
15 $ENV{${module_uc}_DIR}
22 /opt/local # DarwinPorts
27 endfunction(OSG_FIND_PATH module header)
33 function(OSG_FIND_LIBRARY module library)
34 string(TOUPPER ${module} module_uc)
36 find_library(${module_uc}_LIBRARY
39 $ENV{${module_uc}_DIR}
43 PATH_SUFFIXES lib64 lib
46 /opt/local # DarwinPorts
52 find_library(${module_uc}_LIBRARY_DEBUG
55 $ENV{${module_uc}_DIR}
59 PATH_SUFFIXES lib64 lib
62 /opt/local # DarwinPorts
68 if(NOT ${module_uc}_LIBRARY_DEBUG)
69 # They don't have a debug library
70 set(${module_uc}_LIBRARY_DEBUG ${${module_uc}_LIBRARY} PARENT_SCOPE)
71 set(${module_uc}_LIBRARIES ${${module_uc}_LIBRARY} PARENT_SCOPE)
73 # They really have a FOO_LIBRARY_DEBUG
74 set(${module_uc}_LIBRARIES
75 optimized ${${module_uc}_LIBRARY}
76 debug ${${module_uc}_LIBRARY_DEBUG}
80 endfunction(OSG_FIND_LIBRARY module library)
83 # OSG_MARK_AS_ADVANCED
84 # Just a convenience function for calling MARK_AS_ADVANCED
86 function(OSG_MARK_AS_ADVANCED _module)
87 string(TOUPPER ${_module} _module_UC)
88 mark_as_advanced(${_module_UC}_INCLUDE_DIR)
89 mark_as_advanced(${_module_UC}_LIBRARY)
90 mark_as_advanced(${_module_UC}_LIBRARY_DEBUG)