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

Revision 9751, 8.0 kB (checked in by robert, 5 years ago)

From Roger James and Robert Osfield, fixes and reorganization to better support Windows dyanmic library build

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