1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
4 IF(OSGColladaSrcDir AND OSGPcreSrcDir AND OSGLibXml2SrcDir)
5 SET(_OSG_COLLADA_PRECOND TRUE)
7 SET(_OSG_COLLADA_PRECOND FALSE)
8 ENDIF(OSGColladaSrcDir AND OSGPcreSrcDir AND OSGLibXml2SrcDir)
12 IF(OSGColladaSrcDir AND LIBXML2_FOUND)
13 SET(_OSG_COLLADA_PRECOND TRUE)
15 SET(_OSG_COLLADA_PRECOND FALSE)
16 ENDIF(OSGColladaSrcDir AND LIBXML2_FOUND)
20 IF(_OSG_COLLADA_PRECOND)
22 MESSAGE(STATUS "adding collada from : ${OSGColladaSrcDir}")
26 SET(${PROJECT_NAME}SharedTarget_14 osgcollada14dom22)
27 SET(${PROJECT_NAME}SharedTarget_15 osgcollada15dom22)
30 SET(${PROJECT_NAME}StaticTarget_14 libosgcollada14dom24)
31 SET(${PROJECT_NAME}StaticTarget_15 libosgcollada15dom24)
33 SET(${PROJECT_NAME}StaticTarget_14 osgcollada14dom24lib)
34 SET(${PROJECT_NAME}StaticTarget_15 osgcollada15dom24lib)
37 # FILE(GLOB variable [RELATIVE path] [globbing expressions]...)
39 FILE(GLOB OSG_COLLADADAE_SRCS "${OSGColladaSrcDir}/dom/src/dae/*.cpp")
41 SET(OSG_COLLADADAE_SRCS ${OSG_COLLADADAE_SRCS}
42 ${OSGColladaSrcDir}/dom/src/modules/STLDatabase/daeSTLDatabase.cpp
43 ${OSGColladaSrcDir}/dom/src/modules/stdErrPlugin/stdErrPlugin.cpp
44 ${OSGColladaSrcDir}/dom/src/modules/LIBXMLPlugin/daeLIBXMLPlugin.cpp
45 ${OSGColladaSrcDir}/dom/external-libs/minizip-1.1/ioapi.c
46 ${OSGColladaSrcDir}/dom/external-libs/minizip-1.1/zip.c
47 ${OSGColladaSrcDir}/dom/external-libs/minizip-1.1/unzip.c)
50 SET(OSG_COLLADADAE_SRCS ${OSG_COLLADADAE_SRCS}
51 ${OSGColladaSrcDir}/dom/external-libs/minizip-1.1/iowin32.c)
54 FILE(GLOB OSG_COLLADADAE_HDR "${OSGColladaSrcDir}/dom/include/dae/*.h")
55 FILE(GLOB OSG_COLLADA_HDR "${OSGColladaSrcDir}/dom/include/*.h")
56 FILE(GLOB OSG_COLLADA14_SRCS "${OSGColladaSrcDir}/dom/src/1.4/dom/*.cpp")
57 FILE(GLOB OSG_COLLADA15_SRCS "${OSGColladaSrcDir}/dom/src/1.5/dom/*.cpp")
58 FILE(GLOB OSG_COLLADA14_HDR "${OSGColladaSrcDir}/dom/include/1.4/dom/*.h")
59 FILE(GLOB OSG_COLLADA15_HDR "${OSGColladaSrcDir}/dom/include/1.5/dom/*.h")
61 SET(OSG_COLLADAMOD_HDR ${OSGColladaSrcDir}/dom/include/modules/daeLIBXMLPlugin.h
62 ${OSGColladaSrcDir}/dom/include/modules/stdErrPlugin.h
63 ${OSGColladaSrcDir}/dom/include/modules/daeSTLDatabase.h)
65 SET(OSGCOLLADA_DEF DOM_INCLUDE_LIBXML)
68 SET(OSGCOLLADA_DEF ${OSGCOLLADA_DEF};USE_FILE32API)
72 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
73 "${OSGColladaSrcDir}/dom/external-libs/minizip-1.1/crypt.h"
74 "${CMAKE_BINARY_DIR}/collada/include/crypt.h")
76 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
77 "${OSGColladaSrcDir}/dom/external-libs/minizip-1.1/ioapi.h"
78 "${CMAKE_BINARY_DIR}/collada/include/ioapi.h")
81 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
82 "${OSGColladaSrcDir}/dom/external-libs/minizip-1.1/iowin32.h"
83 "${CMAKE_BINARY_DIR}/collada/include/iowin32.h")
86 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
87 "${OSGColladaSrcDir}/dom/external-libs/minizip-1.1/unzip.h"
88 "${CMAKE_BINARY_DIR}/collada/include/unzip.h")
90 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
91 "${OSGColladaSrcDir}/dom/external-libs/minizip-1.1/zip.h"
92 "${CMAKE_BINARY_DIR}/collada/include/zip.h")
94 INCLUDE_DIRECTORIES(${OSG_BOOST_INCDIRS})
95 INCLUDE_DIRECTORIES(${OSGColladaSrcDir}/dom/include)
96 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)
98 IF(UNIX AND APPLE AND EXISTS /sw/include)
99 INCLUDE_DIRECTORIES(/sw/include)
100 ENDIF(UNIX AND APPLE AND EXISTS /sw/include)
102 IF(UNIX AND APPLE AND EXISTS /sw/lib)
103 LINK_DIRECTORIES(/sw/lib)
104 ENDIF(UNIX AND APPLE AND EXISTS /sw/lib)
107 INCLUDE_DIRECTORIES(${OSGPcreSrcDir})
108 INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/pcre)
109 INCLUDE_DIRECTORIES(${OSGLibXml2SrcDir}/include)
110 INCLUDE_DIRECTORIES(${OSG_ZLIB_INCLUDE_DIR})
112 INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
118 ADD_SUBDIRECTORY(Dom14)
122 IF(OSG_BUILD_COLLADADOM_15)
124 ADD_SUBDIRECTORY(Dom15)
126 ENDIF(OSG_BUILD_COLLADADOM_15)
129 INSTALL(FILES ${OSG_COLLADA_HDR}
130 DESTINATION include${OSG_SUPPORT_INC_SUBDIR}
131 COMPONENT code_headers
132 PERMISSIONS OWNER_WRITE OWNER_READ
135 INSTALL(FILES ${OSG_COLLADADAE_HDR}
136 DESTINATION include${OSG_SUPPORT_INC_SUBDIR}/dae
137 COMPONENT code_headers
138 PERMISSIONS OWNER_WRITE OWNER_READ
141 INSTALL(FILES ${OSG_COLLADAMOD_HDR}
142 DESTINATION include${OSG_SUPPORT_INC_SUBDIR}/modules
143 COMPONENT code_headers
144 PERMISSIONS OWNER_WRITE OWNER_READ
148 INSTALL(FILES ${OSG_COLLADA14_HDR}
149 DESTINATION include${OSG_SUPPORT_INC_SUBDIR}/1.4/dom
150 COMPONENT code_headers
151 PERMISSIONS OWNER_WRITE OWNER_READ
155 IF(OSG_BUILD_COLLADADOM_15)
156 INSTALL(FILES ${OSG_COLLADA15_HDR}
157 DESTINATION include${OSG_SUPPORT_INC_SUBDIR}/1.5/dom
158 COMPONENT code_headers
159 PERMISSIONS OWNER_WRITE OWNER_READ
162 ENDIF(OSG_BUILD_COLLADADOM_15)
164 ELSE(_OSG_COLLADA_PRECOND)
165 MESSAGE(STATUS "ignoring collada")
167 SET(OSGColladaSrcDir "" CACHE PATH "")
168 ENDIF(_OSG_COLLADA_PRECOND)