1 # - Find collada dom libraries
2 # Find the collada dom libraries and headers
4 # This module specifies the following variables:
9 # Additionally the following more specialized variables are defined:
10 # COLLADA_DAE_INCLUDE_DIR DAE header files
11 # COLLADA_DOM_INCLUDE_DIR DOM header files
12 # COLLADA_LIBRARY_DEBUG debug library
13 # COLLADA_LIBRARY_RELEASE release library
15 # You can control where this module attempts to locate libraries and headers:
21 # default include search paths
22 SET(__COLLADA_INCLUDE_SEARCH_DIRS
26 /usr/local/include/colladadom
27 /usr/local/include/collada-dom
29 /usr/include/colladadom
30 /usr/include/collada-dom
33 /opt/local/include/colladadom
34 /opt/local/include/collada-dom
36 /opt/include/colladadom
37 /opt/include/collada-dom)
39 # default library search paths
40 SET(__COLLADA_LIBRARY_SEARCH_DIRS
53 SET(COLLADA_ROOT_DIR_ENV "$ENV{COLLADA_ROOT_DIR}")
55 IF(NOT COLLADA_ROOT_DIR AND COLLADA_ROOT_DIR_ENV)
56 SET(COLLADA_ROOT_DIR "${COLLADA_ROOT_DIR_ENV}")
57 ENDIF(NOT COLLADA_ROOT_DIR AND COLLADA_ROOT_DIR_ENV)
59 # handle COLLADA_ROOT_DIR input variable
61 FILE(TO_CMAKE_PATH ${COLLADA_ROOT_DIR} COLLADA_ROOT_DIR)
63 SET(__COLLADA_INCLUDE_SEARCH_DIRS "${COLLADA_ROOT_DIR}/include"
64 "${COLLADA_ROOT_DIR}/include/colladadom"
65 "${COLLADA_ROOT_DIR}/include/collada-dom"
66 "${__COLLADA_INCLUDE_SEARCH_DIRS}")
67 SET(__COLLADA_LIBRARY_SEARCH_DIRS "${COLLADA_ROOT_DIR}/lib"
68 "${COLLADA_ROOT_DIR}/lib64"
69 "${__COLLADA_LIBRARY_SEARCH_DIRS}")
70 ENDIF(COLLADA_ROOT_DIR)
72 IF(OSG_SUPPORT_ROOT AND OSG_USE_OSGSUPPORT_LIBS)
73 FILE(TO_CMAKE_PATH ${OSG_SUPPORT_ROOT} _OSG_SUPPORT_ROOT)
75 SET(__COLLADA_INCLUDE_SEARCH_DIRS "${_OSG_SUPPORT_ROOT}/include"
76 "${_OSG_SUPPORT_ROOT}/include/colladadom"
77 "${_OSG_SUPPORT_ROOT}/include/collada-dom"
78 "${__COLLADA_INCLUDE_SEARCH_DIRS}")
79 SET(__COLLADA_LIBRARY_SEARCH_DIRS "${_OSG_SUPPORT_ROOT}/lib"
80 "${_OSG_SUPPORT_ROOT}/lib64"
81 "${__COLLADA_LIBRARY_SEARCH_DIRS}")
82 ENDIF(OSG_SUPPORT_ROOT AND OSG_USE_OSGSUPPORT_LIBS)
85 # handle COLLADA_INCLUDE_DIR input variable
86 IF(COLLADA_INCLUDE_DIR)
87 FILE(TO_CMAKE_PATH ${COLLADA_INCLUDE_DIR} COLLADA_INCLUDE_DIR)
88 SET(__COLLADA_INCLUDE_SEARCH_DIRS "${COLLADA_INCLUDE_DIR}"
89 "${__COLLADA_INCLUDE_SEARCH_DIRS}")
90 ENDIF(COLLADA_INCLUDE_DIR)
92 # handle COLLADA_LIBRARY_DIR input variable
93 IF(COLLADA_LIBRARY_DIR)
94 FILE(TO_CMAKE_PATH ${COLLADA_LIBRARY_DIR} COLLADA_LIBRARY_DIR)
95 SET(__COLLADA_LIBRARY_SEARCH_DIRS "${COLLADA_LIBRARY_DIR}"
96 "${__COLLADA_LIBRARY_SEARCH_DIRS}")
97 ENDIF(COLLADA_LIBRARY_DIR)
101 FIND_PATH(COLLADA_DAE_INCLUDE_DIR dae.h
102 PATHS ${__COLLADA_INCLUDE_SEARCH_DIRS})
104 FIND_PATH(COLLADA_DOM_INCLUDE_DIR "dom/domNode.h"
105 PATHS ${__COLLADA_INCLUDE_SEARCH_DIRS}
108 IF(OSG_USE_OSGSUPPORT_LIBS)
110 FIND_LIBRARY(COLLADA_LIBRARY_RELEASE
111 NAMES osgcollada14dom22 osgcollada14dom22lib collada_dom collada14dom libcollada14dom21
112 PATHS ${__COLLADA_LIBRARY_SEARCH_DIRS})
114 FIND_LIBRARY(COLLADA_LIBRARY_DEBUG
115 NAMES osgcollada14dom22 osgcollada14dom22lib collada_dom-d collada14dom-d libcollada14dom21-d
117 PATHS ${__COLLADA_LIBRARY_SEARCH_DIRS})
120 FIND_LIBRARY(COLLADA_LIBRARY_RELEASE
121 NAMES collada_dom collada14dom libcollada14dom21
122 PATHS ${__COLLADA_LIBRARY_SEARCH_DIRS})
124 FIND_LIBRARY(COLLADA_LIBRARY_DEBUG
125 NAMES collada_dom-d collada14dom-d libcollada14dom21-d
126 PATHS ${__COLLADA_LIBRARY_SEARCH_DIRS})
129 # handle the QUIETLY and REQUIRED arguments and set COLLADA_FOUND to TRUE if
130 # all listed variables are TRUE
131 INCLUDE(FindPackageHandleStandardArgs)
132 FIND_PACKAGE_HANDLE_STANDARD_ARGS(COLLADA DEFAULT_MSG COLLADA_LIBRARY_RELEASE
133 COLLADA_DAE_INCLUDE_DIR
134 COLLADA_DOM_INCLUDE_DIR)
136 # if only the debug or release lib was found, use it for both configurations,
137 # except on windows where the runtimes have to match
139 IF(COLLADA_LIBRARY_RELEASE AND NOT COLLADA_LIBRARY_DEBUG)
140 SET(COLLADA_LIBRARY_DEBUG "${COLLADA_LIBRARY_RELEASE}")
141 ELSEIF(COLLADA_LIBRARY_DEBUG AND NOT COLLADA_LIBRARY_RELEASE)
142 SET(COLLADA_LIBRARY_RELEASE "${COLLADA_LIBRARY_DEBUG}")
143 ENDIF(COLLADA_LIBRARY_RELEASE AND NOT COLLADA_LIBRARY_DEBUG)
146 # set output variables
148 GET_FILENAME_COMPONENT(__COLLADA_LIB_DIR_RELEASE "${COLLADA_LIBRARY_RELEASE}" PATH)
149 GET_FILENAME_COMPONENT(__COLLADA_LIB_DIR_DEBUG "${COLLADA_LIBRARY_DEBUG}" PATH)
151 SET(COLLADA_LIBRARY_DIRS "${__COLLADA_LIB_DIR_RELEASE}"
152 "${__COLLADA_LIB_DIR_DEBUG}" )
153 SET(COLLADA_INCLUDE_DIRS "${COLLADA_DAE_INCLUDE_DIR}"
154 "${COLLADA_DOM_INCLUDE_DIR}" )
156 SET(COLLADA_LIBRARIES "${COLLADA_LIBRARY_RELEASE}")