root/OpenSceneGraph/trunk/CMakeModules/FindCOLLADA.cmake @ 9952

Revision 9952, 8.1 kB (checked in by robert, 5 years ago)

From Michael Platings, "I've changed this file so CMake automatically chooses the correct directories & libs out of vc8,vc9,mac,mingw
Tested with Visual Studio 9 2008"

  • Property svn:eol-style set to native
RevLine 
[9307]1# Locate Collada
2# This module defines:
[6606]3# COLLADA_INCLUDE_DIR, where to find the headers
4#
[9307]5# COLLADA_LIBRARY, COLLADA_LIBRARY_DEBUG
6# COLLADA_FOUND, if false, do not try to link to Collada dynamically
7#
8# COLLADA_LIBRARY_STATIC, COLLADA_LIBRARY_STATIC_DEBUG
9# COLLADA_STATIC_FOUND, if false, do not try to link to Collada statically
10#
[6606]11# $COLLADA_DIR is an environment variable that would
12# correspond to the ./configure --prefix=$COLLADA_DIR
13#
14# Created by Robert Osfield.
15
[9741]16SET(COLLADA_DOM_ROOT "$ENV{COLLADA_DIR}/dom" CACHE PATH "Location of Collada DOM directory")
17
[9952]18IF(APPLE)
19    SET(COLLADA_BUILDNAME "mac")
20ELSEIF(MINGW)
21    SET(COLLADA_BUILDNAME "mingw")
22ELSEIF(MSVC90)
23    SET(COLLADA_BUILDNAME "vc9")
24ELSE(APPLE)
25    SET(COLLADA_BUILDNAME "vc8")
26ENDIF(APPLE)
27
28
[6606]29FIND_PATH(COLLADA_INCLUDE_DIR dae.h
[9741]30    ${COLLADA_DOM_ROOT}/include
[6606]31    $ENV{COLLADA_DIR}/include
32    $ENV{COLLADA_DIR}
33    $ENV{OSGDIR}/include
34    $ENV{OSGDIR}
35    $ENV{OSG_ROOT}/include
36    ~/Library/Frameworks
37    /Library/Frameworks
38    /usr/local/include
[8282]39    /usr/local/include/colladadom
40    /usr/include/
41    /usr/include/colladadom
[6606]42    /sw/include # Fink
43    /opt/local/include # DarwinPorts
44    /opt/csw/include # Blastwave
45    /opt/include
46    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
47    /usr/freeware/include
48)
49
[9307]50FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
[9260]51    NAMES collada_dom collada14dom libcollada14dom21
[6606]52    PATHS
[9952]53    ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4
54    $ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4
[6606]55    $ENV{COLLADA_DIR}/lib
56    $ENV{COLLADA_DIR}/lib-dbg
57    $ENV{COLLADA_DIR}
58    $ENV{OSGDIR}/lib
59    $ENV{OSGDIR}
60    $ENV{OSG_ROOT}/lib
61    ~/Library/Frameworks
62    /Library/Frameworks
63    /usr/local/lib
[8282]64    /usr/local/lib64
[6606]65    /usr/lib
[8282]66    /usr/lib64
[6606]67    /sw/lib
68    /opt/local/lib
69    /opt/csw/lib
70    /opt/lib
71    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
72    /usr/freeware/lib64
73)
74
[9307]75FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG
[9260]76    NAMES collada_dom-d collada14dom-d libcollada14dom21-d
77    PATHS
[9952]78    ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d
79    $ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4-d
[9260]80    $ENV{COLLADA_DIR}/lib
81    $ENV{COLLADA_DIR}/lib-dbg
82    $ENV{COLLADA_DIR}
83    $ENV{OSGDIR}/lib
84    $ENV{OSGDIR}
85    $ENV{OSG_ROOT}/lib
86    ~/Library/Frameworks
87    /Library/Frameworks
88    /usr/local/lib
89    /usr/local/lib64
90    /usr/lib
91    /usr/lib64
92    /sw/lib
93    /opt/local/lib
94    /opt/csw/lib
95    /opt/lib
96    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
97    /usr/freeware/lib64
98)
99
[9741]100FIND_LIBRARY(COLLADA_STATIC_LIBRARY
101    NAMES libcollada14dom21-s
[9307]102    PATHS
[9952]103    ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4
104    $ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4
[9307]105    $ENV{COLLADA_DIR}/lib
106    $ENV{COLLADA_DIR}/lib-dbg
107    $ENV{COLLADA_DIR}
108    $ENV{OSGDIR}/lib
109    $ENV{OSGDIR}
110    $ENV{OSG_ROOT}/lib
111    ~/Library/Frameworks
112    /Library/Frameworks
113    /usr/local/lib
114    /usr/local/lib64
115    /usr/lib
116    /usr/lib64
117    /sw/lib
118    /opt/local/lib
119    /opt/csw/lib
120    /opt/lib
121    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
122    /usr/freeware/lib64
123)
[6606]124
[9307]125FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
126    NAMES collada_dom-sd collada14dom-sd libcollada14dom21-sd
127    PATHS
[9952]128    ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d
129    $ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4-d
[9307]130    $ENV{COLLADA_DIR}/lib
131    $ENV{COLLADA_DIR}/lib-dbg
132    $ENV{COLLADA_DIR}
133    $ENV{OSGDIR}/lib
134    $ENV{OSGDIR}
135    $ENV{OSG_ROOT}/lib
136    ~/Library/Frameworks
137    /Library/Frameworks
138    /usr/local/lib
139    /usr/local/lib64
140    /usr/lib
141    /usr/lib64
142    /sw/lib
143    /opt/local/lib
144    /opt/csw/lib
145    /opt/lib
146    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
147    /usr/freeware/lib64
148)
[6606]149
[9741]150IF(COLLADA_STATIC_LIBRARY)
151
152    # find extra libraries that the static linking requires
153
154    FIND_PACKAGE(LibXml2)
155    IF (LIBXML2_FOUND)
156        SET(COLLADA_LIBXML_LIBRARY ${LIBXML2_LIBRARIES})
157    ELSE(LIBXML2_FOUND)
[9751]158        IF(WIN32)
159            FIND_LIBRARY(COLLADA_LIBXML_LIBRARY
160                NAMES libxml2
161                PATHS
162                ${COLLADA_DOM_ROOT}/external-libs/libxml2/win32/lib
163                ${COLLADA_DOM_ROOT}/external-libs/libxml2/mingw/lib
164            )
165        ENDIF(WIN32)
[9741]166    ENDIF(LIBXML2_FOUND)
167   
168    FIND_PACKAGE(ZLIB)
169    IF (ZLIB_FOUND)
170        SET(COLLADA_ZLIB_LIBRARY ${ZLIB_LIBRARY})
171    ELSE(ZLIB_FOUND)
[9751]172        IF(WIN32)
173            FIND_LIBRARY(COLLADA_ZLIB_LIBRARY
174                NAMES zlib
175                PATHS
176                ${COLLADA_DOM_ROOT}/external-libs/libxml2/win32/lib
177                ${COLLADA_DOM_ROOT}/external-libs/libxml2/mingw/lib
178            )
179        ENDIF(WIN32)
180    ENDIF(ZLIB_FOUND)
181
182    IF(WIN32)
183
184        FIND_LIBRARY(COLLADA_PCRECPP_LIBRARY
185            NAMES pcrecpp
[9741]186            PATHS
[9952]187            ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME}   
[9751]188            ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
189            ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw   
[9741]190        )
191
[9751]192        FIND_LIBRARY(COLLADA_PCRECPP_LIBRARY_DEBUG
193            NAMES pcrecpp-d
194            PATHS
[9952]195            ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME}   
[9751]196            ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
197            ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw   
198        )
[9741]199
[9751]200        FIND_LIBRARY(COLLADA_PCRE_LIBRARY
201            NAMES pcre
202            PATHS
[9952]203            ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME}   
[9751]204            ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
205            ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw   
206        )
[9741]207
[9751]208        FIND_LIBRARY(COLLADA_PCRE_LIBRARY_DEBUG
209            NAMES pcre-d
210            PATHS
[9952]211            ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME}   
[9751]212            ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
213            ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw
214        )
[9741]215
[9751]216        FIND_LIBRARY(COLLADA_MINIZIP_LIBRARY
217            NAMES minizip
218            PATHS
219            ${COLLADA_DOM_ROOT}/external-libs/minizip/win32/lib
220            ${COLLADA_DOM_ROOT}/external-libs/minizip/mac
221        )
[9741]222
[9751]223        FIND_LIBRARY(COLLADA_MINIZIP_LIBRARY_DEBUG
224            NAMES minizip-d
225            PATHS
226            ${COLLADA_DOM_ROOT}/external-libs/minizip/win32/lib
227            ${COLLADA_DOM_ROOT}/external-libs/minizip/mac
228        )
229   
230    ENDIF(WIN32)
[9741]231
[9751]232ENDIF(COLLADA_STATIC_LIBRARY)
[9741]233
[9751]234IF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
[9741]235
[9751]236    IF(WIN32)
237   
238        FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY
239            NAMES libboost_filesystem
240            PATHS
[9952]241            ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
[9751]242            ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
243        )
[9741]244
[9751]245        FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG
246            NAMES libboost_filesystem-d
247            PATHS
[9952]248            ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
[9751]249            ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
250        )
[9741]251
[9751]252        FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY
253            NAMES libboost_system
254            PATHS
[9952]255            ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
[9751]256            ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
257        )
[9741]258
[9751]259        FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG
260            NAMES libboost_system-d
261            PATHS
[9952]262            ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
[9751]263            ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
264        )
[9741]265
[9759]266      FIND_PATH(COLLADA_BOOST_INCLUDE_DIR boost/filesystem/convenience.hpp
267        ${COLLADA_DOM_ROOT}/external-libs/boost
268      )
[9751]269
270    ENDIF(WIN32)
271
272ENDIF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
273
[9307]274SET(COLLADA_FOUND "NO")
275IF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
276    IF   (COLLADA_INCLUDE_DIR)
277        SET(COLLADA_FOUND "YES")
278    ENDIF(COLLADA_INCLUDE_DIR)
279ENDIF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
Note: See TracBrowser for help on using the browser.