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

Revision 10226, 7.2 kB (checked in by robert, 5 years ago)

From Philip Lowman, removed inappropriate references to OSG_ in 3rd party libs searches

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