fixed: auto_ptr -> unique_ptr
[opensg.git] / CMake / OSGConfigurePackages.cmake
blob36d1536aa6b8f1900d769a457ef4406345b6c25f
2 ##############################################################################
3 # ZLIB
4 ##############################################################################
6 MACRO(OSG_CONFIGURE_ZLIB)
8     IF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
10         IF(EXISTS ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/zlib.h)
11             SET(ZLIB_INCLUDE_DIR ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR} CACHE PATH "" FORCE)
12         ENDIF()
14         IF(OSG_USE_STATIC_SUPPORT_LIBS)
15             IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgzlib.lib)
16                 SET(ZLIB_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgzlib.lib)
17             ENDIF()
18             IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgzlibD.lib)
19                 SET(ZLIB_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgzlibD.lib)
20             ENDIF()
21         ELSE()
22             IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgzlib.lib)
23                 SET(ZLIB_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/osgzlib.lib)
24             ENDIF()
25             IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgzlibD.lib)
26                 SET(ZLIB_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/osgzlibD.lib)
27             ENDIF()
28         ENDIF()
30         IF(ZLIB_INCLUDE_DIR)
31             IF(ZLIB_LIBRARY_DEBUG OR ZLIB_LIBRARY_RELEASE)
32                 SET(ZLIB_FOUND TRUE)
33             ENDIF()
34         ENDIF()
36         IF(ZLIB_FOUND)
37           OSG_ADD_IMPORT_LIB(OSG_ZLIB_TARGETS ZLIB_LIBRARY)
38           SET(ZLIB_LIBRARIES ${OSG_ZLIB_TARGETS} CACHE STRING "" FORCE)
39         ENDIF(ZLIB_FOUND)
41     ENDIF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
43     IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT ZLIB_FOUND)
45         OSG_FIND_PACKAGE(ZLIB_OpenSG)
47         IF(ZLIB_FOUND)
48           OSG_ADD_IMPORT_LIB(OSG_ZLIB_TARGETS ZLIB_LIBRARY)
50           SET(ZLIB_LIBRARIES ${OSG_ZLIB_TARGETS} CACHE STRING "" FORCE)
52           OSG_ADD_OPT(ZLIB_LIBRARIES)
53         ENDIF(ZLIB_FOUND)
55     ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT ZLIB_FOUND)
57     IF(ZLIB_FOUND)
58         OSG_SET(OSG_WITH_ZLIB 1)
59     ENDIF(ZLIB_FOUND)
61 ENDMACRO(OSG_CONFIGURE_ZLIB)
63 ##############################################################################
64 # GLUT
65 ##############################################################################
67 MACRO(OSG_CONFIGURE_GLUT)
69     IF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
71         IF(EXISTS ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/GL/glut.h)
72             SET(GLUT_INCLUDE_DIR ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR} CACHE PATH "" FORCE)
73         ENDIF()
75         IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgglut.lib)
76             SET(GLUT_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/osgglut.lib)
77         ENDIF()
78         IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgglutD.lib)
79             SET(GLUT_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/osgglutD.lib)
80         ENDIF()
82         IF(GLUT_INCLUDE_DIR)
83           IF(GLUT_LIBRARY_DEBUG OR GLUT_LIBRARY_RELEASE)
84             SET(GLUT_FOUND TRUE)
85           ENDIF()
86         ENDIF()
88         IF(GLUT_FOUND)
89           OSG_ADD_IMPORT_LIB(OSG_GLUT_TARGETS GLUT_LIBRARY)
90           SET(GLUT_LIBRARIES ${OSG_GLUT_TARGETS} CACHE STRING "" FORCE)
91         ENDIF(GLUT_FOUND)
93     ENDIF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
95     IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT GLUT_FOUND)
97       IF(WIN32)
98         OSG_FIND_PACKAGE(GLUT_OpenSG)
100         IF(GLUT_FOUND)
101           OSG_ADD_IMPORT_LIB(OSG_GLUT_TARGETS GLUT_glut_LIBRARY)
103           SET(GLUT_LIBRARIES ${OSG_GLUT_TARGETS} CACHE STRING "" FORCE)
104         ENDIF(GLUT_FOUND)
106       ELSE(WIN32)
107         OSG_FIND_PACKAGE(GLUT)
108       ENDIF(WIN32)
110     ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT GLUT_FOUND)
112 ENDMACRO(OSG_CONFIGURE_GLUT)
114 ##############################################################################
115 # GDAL
116 ##############################################################################
118 MACRO(OSG_CONFIGURE_GDAL)
120     IF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
122         IF(EXISTS ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/gdal/gdal_priv.h)
123             SET(GDAL_INCLUDE_DIR ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/gdal CACHE PATH "" FORCE)
124         ENDIF()
126         IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osggdal.lib)
127             SET(GDAL_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/osggdal.lib)
128         ENDIF()
129         IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osggdalD.lib)
130             SET(GDAL_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/osggdalD.lib)
131         ENDIF()
133         IF(GDAL_INCLUDE_DIR)
134           IF(GDAL_LIBRARY_DEBUG OR GDAL_LIBRARY_RELEASE)
135             SET(GDAL_FOUND TRUE)
136           ENDIF()
137         ENDIF()
139         IF(GDAL_FOUND)
140           OSG_ADD_IMPORT_LIB(OSG_GDAL_TARGETS GDAL_LIBRARY)
141           SET(GDAL_LIBRARIES ${OSG_GDAL_TARGETS} CACHE STRING "" FORCE)
142         ENDIF(GDAL_FOUND)
144     ENDIF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
146     IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT GDAL_FOUND)
148       IF(WIN32)
149         OSG_FIND_PACKAGE(GDAL_OpenSG)
151         IF(GDAL_FOUND)
152           OSG_ADD_IMPORT_LIB(OSG_GDAL_TARGETS GDAL_LIBRARY)
154           SET(GDAL_LIBRARIES ${OSG_GDAL_TARGETS} CACHE STRING "" FORCE)
155         ENDIF(GDAL_FOUND)
157       ELSE(WIN32)
158         OSG_FIND_PACKAGE(GDAL)
159       ENDIF(WIN32)
161     ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT GDAL_FOUND)
163 ENDMACRO(OSG_CONFIGURE_GDAL)
165 ##############################################################################
166 # PNG
167 ##############################################################################
169 MACRO(OSG_CONFIGURE_PNG)
171     IF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
173       IF(EXISTS ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/png.h)
174         SET(PNG_PNG_INCLUDE_DIR ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR} CACHE PATH "" FORCE)
175       ENDIF()
177       IF(OSG_USE_STATIC_SUPPORT_LIBS)
178         IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgpng.lib)
179           SET(PNG_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgpng.lib)
180         ENDIF()
181         IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgpngD.lib)
182           SET(PNG_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgpngD.lib)
183         ENDIF()
184       ELSE()
185         IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgpng.lib)
186           SET(PNG_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/osgpng.lib)
187         ENDIF()
188         IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgpngD.lib)
189           SET(PNG_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/osgpngD.lib)
190         ENDIF()
191       ENDIF()
193       IF(PNG_PNG_INCLUDE_DIR)
194         IF(PNG_LIBRARY_DEBUG OR PNG_LIBRARY_RELEASE)
195           SET(PNG_FOUND TRUE)
196         ENDIF()
197       ENDIF()
199       IF(PNG_FOUND)
200         OSG_ADD_IMPORT_LIB(OSG_PNG_TARGETS PNG_LIBRARY)
201         SET(PNG_LIBRARIES ${OSG_PNG_TARGETS} CACHE STRING "" FORCE)
202       ENDIF(PNG_FOUND)
204     ENDIF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
206     IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT PNG_FOUND)
208         OSG_FIND_PACKAGE(PNG_OpenSG)
210         IF(PNG_FOUND)
211           OSG_ADD_IMPORT_LIB(OSG_PNG_TARGETS PNG_LIBRARY)
213           SET(PNG_LIBRARIES ${OSG_PNG_TARGETS} CACHE STRING "" FORCE)
215           SET(PNG_INCLUDE_DIR "${PNG_INCLUDE_DIR};${ZLIB_INCLUDE_DIR}")
217           SET_TARGET_PROPERTIES(${OSG_PNG_TARGETS} PROPERTIES
218                                 IMPORTED_LINK_INTERFACE_LIBRARIES ${OSG_ZLIB_TARGETS})
220           OSG_ADD_OPT(OSG_PNG_TARGETS)
222         ENDIF(PNG_FOUND)
223     ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT PNG_FOUND)
225 ENDMACRO(OSG_CONFIGURE_PNG)
227 ##############################################################################
228 # TIFF
229 ##############################################################################
231 MACRO(OSG_CONFIGURE_TIFF)
233     IF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
235       IF(EXISTS ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/tiff.h)
236         SET(TIFF_INCLUDE_DIR ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR} CACHE PATH "" FORCE)
237       ENDIF()
239       IF(OSG_USE_STATIC_SUPPORT_LIBS)
240         IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgtiff.lib)
241           SET(TIFF_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgtiff.lib)
242         ENDIF()
243           IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgtiffD.lib)
244             SET(TIFF_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgtiffD.lib)
245           ENDIF()
246         ELSE()
247           IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgtiff.lib)
248             SET(TIFF_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/osgtiff.lib)
249           ENDIF()
250           IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgtiffD.lib)
251             SET(TIFF_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/osgtiffD.lib)
252           ENDIF()
253         ENDIF()
255         IF(TIFF_INCLUDE_DIR)
256           IF(TIFF_LIBRARY_DEBUG OR TIFF_LIBRARY_RELEASE)
257             SET(TIFF_FOUND TRUE)
258           ENDIF()
259         ENDIF()
261         IF(TIFF_FOUND)
262           OSG_ADD_IMPORT_LIB(OSG_TIFF_TARGETS TIFF_LIBRARY)
263           SET(TIFF_LIBRARIES ${OSG_TIFF_TARGETS} CACHE STRING "" FORCE)
264         ENDIF(TIFF_FOUND)
266     ENDIF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
268     IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT TIFF_FOUND)
269         OSG_FIND_PACKAGE(TIFF_OpenSG)
271         IF(TIFF_FOUND)
272           OSG_ADD_IMPORT_LIB(OSG_TIFF_TARGETS TIFF_LIBRARY)
274           SET(TIFF_LIBRARIES ${OSG_TIFF_TARGETS} CACHE STRING "" FORCE)
275         ENDIF(TIFF_FOUND)
276     ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT TIFF_FOUND)
278 ENDMACRO(OSG_CONFIGURE_TIFF)
280 ##############################################################################
281 # OpenEXR
282 ##############################################################################
284 MACRO(OSG_CONFIGURE_OPENEXR)
286     IF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
288       IF(EXISTS ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/OpenEXR/ImfIO.h)
289         SET(OPENEXR_INCLUDE_DIR ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR};${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/OpenEXR CACHE PATH "" FORCE)
290       ENDIF()
292       IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgilmimf.lib)
293         SET(OPENEXR_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgilmimf.lib)
294       ENDIF()
295       IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgilmimfD.lib)
296         SET(OPENEXR_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgilmimfD.lib)
297       ENDIF()
299         #      IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/)
300         #        SET(OPENEXR__LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/)
301         #     ENDIF()
302         #      IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/)
303         #        SET(OPENEXR__LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/)
304         #     ENDIF()
306       IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgilmthread.lib)
307         SET(OPENEXR_ILMTHREAD_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgilmthread.lib)
308       ENDIF()
309       IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgilmthreadD.lib)
310         SET(OPENEXR_ILMTHREAD_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgilmthreadD.lib)
311       ENDIF()
312       IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgIex.lib)
313         SET(OPENEXR_IEX_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgIex.lib)
314       ENDIF()
315       IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgIexD.lib)
316         SET(OPENEXR_IEX_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgIexD.lib)
317       ENDIF()
318       IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgHalf.lib)
319         SET(OPENEXR_HALF_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgHalf.lib)
320       ENDIF()
321       IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgHalfD.lib)
322         SET(OPENEXR_HALF_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgHalfD.lib)
323       ENDIF()
325       IF(OPENEXR_INCLUDE_DIR)
326         IF(OPENEXR_LIBRARY_DEBUG OR OPENEXR_LIBRARY_RELEASE)
327           SET(OPENEXR_FOUND TRUE)
328         ENDIF()
329       ENDIF()
331       IF(OPENEXR_FOUND)
332         OSG_ADD_IMPORT_LIB(OSG_OPENEXR_TARGETS OPENEXR_LIBRARY)
333         OSG_ADD_IMPORT_LIB(OSG_OPENEXR_TARGETS OPENEXR_ILMTHREAD_LIBRARY)
334         OSG_ADD_IMPORT_LIB(OSG_OPENEXR_TARGETS OPENEXR_IEX_LIBRARY)
335         OSG_ADD_IMPORT_LIB(OSG_OPENEXR_TARGETS OPENEXR_HALF_LIBRARY)
337         SET(OPENEXR_LIBRARIES ${OSG_OPENEXR_TARGETS} CACHE STRING "" FORCE)
338       ENDIF(OPENEXR_FOUND)
340     ENDIF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
342     IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT OPENEXR_FOUND)
343         OSG_FIND_PACKAGE(OpenEXR)
345         IF(OPENEXR_FOUND)
346           OSG_ADD_IMPORT_LIB(OSG_OPENEXR_TARGETS OPENEXR_LIBRARY_IMF)
347           OSG_ADD_IMPORT_LIB(OSG_OPENEXR_TARGETS OPENEXR_LIBRARY_ILMTHREAD)
348           OSG_ADD_IMPORT_LIB(OSG_OPENEXR_TARGETS OPENEXR_LIBRARY_IEX)
349           OSG_ADD_IMPORT_LIB(OSG_OPENEXR_TARGETS OPENEXR_LIBRARY_HALF)
351           SET(OPENEXR_LIBRARIES ${OSG_OPENEXR_TARGETS} CACHE STRING "" FORCE)
352         ENDIF(OPENEXR_FOUND)
353     ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT OPENEXR_FOUND)
355     IF(OPENEXR_FOUND)
356       OSG_OPTION(OPENEXR_USE_DLL "" OFF)
357     ENDIF(OPENEXR_FOUND)
359 ENDMACRO(OSG_CONFIGURE_OPENEXR)
361 ##############################################################################
362 # JPEG
363 ##############################################################################
365 MACRO(OSG_CONFIGURE_JPEG)
367     IF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
369       IF(EXISTS ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/jpeglib.h)
370         SET(JPEG_INCLUDE_DIR ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR} CACHE PATH "" FORCE)
371       ENDIF()
373       IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgjpg.lib)
374         SET(JPEG_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgjpg.lib)
375       ENDIF()
376       IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgjpgD.lib)
377         SET(JPEG_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgjpgD.lib)
378       ENDIF()
380       IF(JPEG_INCLUDE_DIR)
381         IF(JPEG_LIBRARY_DEBUG OR JPEG_LIBRARY_RELEASE)
382           SET(JPEG_FOUND TRUE)
383         ENDIF()
384       ENDIF()
386       IF(JPEG_FOUND)
387         OSG_ADD_IMPORT_LIB(OSG_JPEG_TARGETS JPEG_LIBRARY)
388         SET(JPEG_LIBRARIES ${OSG_JPEG_TARGETS} CACHE STRING "" FORCE)
389       ENDIF(JPEG_FOUND)
391     ENDIF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
393     IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT JPEG_FOUND)
394       OSG_FIND_PACKAGE(JPEG_OpenSG)
396       IF(JPEG_FOUND)
397         OSG_ADD_IMPORT_LIB(OSG_JPEG_TARGETS JPEG_LIBRARY)
399         SET(JPEG_LIBRARIES ${OSG_JPEG_TARGETS} CACHE STRING "" FORCE)
400       ENDIF(JPEG_FOUND)
401     ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT JPEG_FOUND)
403 ENDMACRO(OSG_CONFIGURE_JPEG)
405 ##############################################################################
406 # Collada
407 ##############################################################################
409 MACRO(OSG_CONFIGURE_COLLADA)
410     IF(OSG_USE_OSGSUPPORT_LIBS)
412         IF(EXISTS ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/dae.h)
413             SET(COLLADA_DAE_INCLUDE_DIR ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR} CACHE PATH "" FORCE)
414         ENDIF()
415         IF(EXISTS ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/1.4/dom/domTypes.h)
416             SET(COLLADA_DOM_INCLUDE_DIR ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/1.4 CACHE PATH "" FORCE)
418             FILE(READ "${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/1.4/dom/domTypes.h" _OSG_COLLADADOMTYPES_H_CONTENTS)
420             STRING(REGEX MATCH "^.*(namespace ColladaDOM).*" _COLLADA_NAMESPACE "${_OSG_COLLADADOMTYPES_H_CONTENTS}")
422             IF(_COLLADA_NAMESPACE)
423               OSG_SET(OSG_WITH_COLLADA_NAMESPACE 1)
424               OSG_SET(COLLADA_DOM_SUPPORT141 1)
425             ENDIF()
427         ENDIF()
429         IF(UNIX)
430             IF(OSG_USE_STATIC_SUPPORT_LIBS)
431                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgcollada14dom22lib.a)
432                     SET(COLLADA_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgcollada14dom22lib.a "" CACHE INTERNAL "" FORCE)
433                 ENDIF()
434                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgcollada14dom22lib.a)
435                     SET(COLLADA_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgcollada14dom22lib.a "" CACHE INTERNAL "" FORCE)
436                 ENDIF()
437             ELSE(OSG_USE_STATIC_SUPPORT_LIBS)
438                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgcollada14dom22${CMAKE_SHARED_LIBRARY_SUFFIX})
439                     SET(COLLADA_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgcollada14dom22${CMAKE_SHARED_LIBRARY_SUFFIX} "" CACHE INTERNAL "" FORCE)
440                 ENDIF()
441                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgcollada14dom22${CMAKE_SHARED_LIBRARY_SUFFIX})
442                     SET(COLLADA_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgcollada14dom22${CMAKE_SHARED_LIBRARY_SUFFIX} "" CACHE INTERNAL "" FORCE)
443                 ENDIF()
444             ENDIF(OSG_USE_STATIC_SUPPORT_LIBS)
445         ELSEIF(WIN32)
446             IF(OSG_USE_STATIC_SUPPORT_LIBS)
447                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgcollada14dom22.lib)
448                     SET(COLLADA_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgcollada14dom22.lib)
449                 ENDIF()
450                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgcollada14dom22D.lib)
451                     SET(COLLADA_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgcollada14dom22D.lib)
452                 ENDIF()
454                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgxml2.lib)
455                     SET(COLLADA_XML2_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgxml2.lib)
456                 ENDIF()
457                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgxml2D.lib)
458                     SET(COLLADA_XML2_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgxml2D.lib)
459                 ENDIF()
461                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgpcrecpp.lib)
462                     SET(COLLADA_PCRECPP_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgpcrecpp.lib)
463                 ENDIF()
464                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgpcrecppD.lib)
465                     SET(COLLADA_PCRECPP_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgpcrecppD.lib)
466                 ENDIF()
468                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgpcre.lib)
469                     SET(COLLADA_PCRE_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgpcre.lib)
470                 ENDIF()
471                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgpcreD.lib)
472                     SET(COLLADA_PCRE_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgpcreD.lib)
473                 ENDIF()
474             ELSE(OSG_USE_STATIC_SUPPORT_LIBS)
475                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgcollada14dom22.lib)
476                     SET(COLLADA_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/osgcollada14dom22.lib)
477                 ENDIF()
478                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgcollada14dom22D.lib)
479                     SET(COLLADA_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/osgcollada14dom22D.lib)
480                 ENDIF()
481             ENDIF(OSG_USE_STATIC_SUPPORT_LIBS)
482         ENDIF()
484         SET(OSG_COLLADA_TARGETS )
486         #   SET(COLLADA_LIBRARIES ${OSG_COLLADA_TARGETS} CACHE STRING "" FORCE)
488         IF(COLLADA_DAE_INCLUDE_DIR AND COLLADA_DOM_INCLUDE_DIR)
489             IF(COLLADA_LIBRARY_DEBUG OR COLLADA_LIBRARY_RELEASE)
490                 SET(COLLADA_FOUND TRUE)
491             ENDIF()
492         ENDIF()
494         IF(COLLADA_FOUND)
495             OSG_ADD_IMPORT_LIB(OSG_COLLADA_TARGETS COLLADA_LIBRARY)
497             SET(COLLADA_TARGET_FOUND TRUE)
499             IF(OSG_USE_STATIC_SUPPORT_LIBS)
500                 IF(UNIX)
501                 ELSEIF(WIN32)
502                     OSG_ADD_IMPORT_LIB(OSG_COLLADA_TARGETS COLLADA_XML2_LIBRARY)
503                     OSG_ADD_IMPORT_LIB(OSG_COLLADA_TARGETS COLLADA_PCRECPP_LIBRARY)
504                     OSG_ADD_IMPORT_LIB(OSG_COLLADA_TARGETS COLLADA_PCRE_LIBRARY)
505                 ENDIF()
506             ENDIF(OSG_USE_STATIC_SUPPORT_LIBS)
507         ENDIF(COLLADA_FOUND)
509     ENDIF(OSG_USE_OSGSUPPORT_LIBS)
511     IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT COLLADA_FOUND)
513         FIND_PACKAGE(Collada)
515         SET(OSG_COLLADA_TARGETS)
517         IF(COLLADA_FOUND)
518             OSG_ADD_IMPORT_LIB(OSG_COLLADA_TARGETS COLLADA_LIBRARY)
520             FILE(READ "${COLLADA_DOM_INCLUDE_DIR}/dom/domTypes.h" _OSG_COLLADADOMTYPES_H_CONTENTS)
521             STRING(REGEX MATCH "^.*(namespace ColladaDOM).*" _COLLADA_NAMESPACE "${_OSG_COLLADADOMTYPES_H_CONTENTS}")
523             IF(_COLLADA_NAMESPACE)
524                 OSG_SET(OSG_WITH_COLLADA_NAMESPACE 1)
525                 OSG_SET(COLLADA_DOM_SUPPORT141 1)
526             ENDIF()
527         ENDIF(COLLADA_FOUND)
529     ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT COLLADA_FOUND)
531 ENDMACRO(OSG_CONFIGURE_COLLADA)
534 MACRO(OSG_CONFIGURE_OPENNURBS)
535     IF(OSG_USE_OSGSUPPORT_LIBS)
537         IF(EXISTS ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/opennurbs/opennurbs.h)
538             SET(OPENNURBS_INCLUDE_DIR ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR} CACHE PATH "" FORCE)
539         ENDIF()
541         IF(UNIX)
542             IF(OSG_USE_STATIC_SUPPORT_LIBS)
543                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgopennurbslib.a)
544                     SET(OPENNURBS_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgopennurbslib.a "" CACHE INTERNAL "" FORCE)
545                 ENDIF()
546                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgopennurbslib.a)
547                     SET(OPENNURBS_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgopennurbslib.a "" CACHE INTERNAL "" FORCE)
548                 ENDIF()
549             ELSE(OSG_USE_STATIC_SUPPORT_LIBS)
550                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgopennurbs${CMAKE_SHARED_LIBRARY_SUFFIX})
551                     SET(OPENNURBS_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgopennurbs${CMAKE_SHARED_LIBRARY_SUFFIX} "" CACHE INTERNAL "" FORCE)
552                 ENDIF()
553                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgopennurbs${CMAKE_SHARED_LIBRARY_SUFFIX})
554                     SET(OPENNURBS_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgopennurbs${CMAKE_SHARED_LIBRARY_SUFFIX} "" CACHE INTERNAL "" FORCE)
555                 ENDIF()
556             ENDIF(OSG_USE_STATIC_SUPPORT_LIBS)
557         ELSEIF(WIN32)
558             IF(OSG_USE_STATIC_SUPPORT_LIBS)
559                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgopennurbs.lib)
560                     SET(OPENNURBS_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgopennurbs.lib)
561                 ENDIF()
562                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgopennurbsD.lib)
563                     SET(OPENNURBS_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgopennurbsD.lib)
564                 ENDIF()
565             ELSE(OSG_USE_STATIC_SUPPORT_LIBS)
566                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgopennurbs.lib)
567                     SET(OPENNURBS_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/osgopennurbs.lib)
568                 ENDIF()
569                 IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgopennurbsD.lib)
570                     SET(OPENNURBS_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/osgopennurbsD.lib)
571                 ENDIF()
572             ENDIF(OSG_USE_STATIC_SUPPORT_LIBS)
573         ENDIF()
575         SET(OSG_OPENNURBS_TARGETS )
577         IF(OPENNURBS_INCLUDE_DIR)
578           IF(OPENNURBS_LIBRARY_DEBUG OR OPENNURBS_LIBRARY_RELEASE)
579             SET(OPENNURBS_FOUND TRUE)
580           ENDIF()
581         ENDIF()
583         IF(OPENNURBS_FOUND)
584             OSG_ADD_IMPORT_LIB(OSG_OPENNURBS_TARGETS OPENNURBS_LIBRARY)
586             SET(OPENNURBS_TARGET_FOUND TRUE)
587             SET(OPENNURBS_LIBRARIES ${OSG_OPENNURBS_TARGETS} CACHE STRING "" FORCE)
588         ENDIF(OPENNURBS_FOUND)
590     ENDIF(OSG_USE_OSGSUPPORT_LIBS)
592     IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT OPENNURBS_FOUND)
594       IF(WIN32)
595         OSG_FIND_PACKAGE(OpenNurbs_OpenSG)
597         IF(OPENNURBS_FOUND)
598           OSG_ADD_IMPORT_LIB(OSG_OPENNURBS_TARGETS OPENNURBS_LIBRARY)
600           SET(OPENNURBS_LIBRARIES ${OSG_OPENNURBS_TARGETS} CACHE STRING "" FORCE)
601         ENDIF(OPENNURBS_FOUND)
603       ELSE(WIN32)
604         OSG_FIND_PACKAGE(OpenNurbs_OpenSG)
605       ENDIF(WIN32)
607     ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT OPENNURBS_FOUND)
609 ENDMACRO(OSG_CONFIGURE_OPENNURBS)
611 ##############################################################################
612 # Boost
613 ##############################################################################
615 MACRO(OSG_CONFIGURE_BOOST)
617   SET(Boost_NO_BOOST_CMAKE TRUE CACHE INTERNAL "" FORCE)
618   SET(Boost_ADDITIONAL_VERSIONS "1.54.0" 
619                                 "1.54"
620                                 "1.53.0" 
621                                 "1.53"
622                                 "1.52.0" 
623                                 "1.52"
624                                 "1.51.0" 
625                                 "1.51"
626                                 "1.50.0"
627                                 "1.50"
628                                 "1.49.0" 
629                                 "1.49"
630                                 "1.48.0"
631                                 "1.48"
632                                 "1.47.0"
633                                 "1.47.0")
635     IF(APPLE AND IOS)
636       set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM FIRST)
637       set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY FIRST)
638       set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE FIRST)
639     ENDIF(APPLE AND IOS)
641     SET(Boost_USE_MULTITHREADED ON )
643     IF(NOT Boost_USE_STATIC_LIBS)
644         SET(Boost_USE_STATIC_LIBS OFF CACHE INTERNAL "")
645     ENDIF(NOT Boost_USE_STATIC_LIBS)
647     LIST(APPEND OSG_GLOBAL_DEP_DEFS "BOOST_ALL_NO_LIB")
649 #    IF(APPLE AND IOS)
650 #      FIND_PACKAGE(BoostIOS COMPONENTS filesystem system)
651 #    ELSE()
652       FIND_PACKAGE(Boost COMPONENTS filesystem system)
653 #    ENDIF()
655     IF(Boost_FOUND)
657         LIST(APPEND OSG_SYSTEM_DEP_INCDIR OSG_BOOST_INCDIRS)
659         IF(NOT Boost_USE_STATIC_LIBS)
660             LIST(APPEND OSG_GLOBAL_DEP_DEFS "BOOST_ALL_DYN_LINK")
661         ENDIF(NOT Boost_USE_STATIC_LIBS)
663         LIST(APPEND OSG_GLOBAL_DEP_DEFS "BOOST_SYSTEM_NO_DEPRECATED=1")
665         IF(OSG_WIN_VERSION)
666           LIST(APPEND OSG_GLOBAL_DEP_DEFS 
667                       "BOOST_USE_WINAPI_VERSION=${OSG_WIN_VERSION}")
668         ELSE()
669           LIST(APPEND OSG_GLOBAL_DEP_DEFS 
670                       "BOOST_USE_WINAPI_VERSION=0x0601")
671         ENDIF()
673         IF(NOT OSG_ENABLE_BOOST_C++11_STD_ATOMICS)
674           LIST(APPEND OSG_GLOBAL_DEP_DEFS 
675                       "BOOST_NO_CXX11_HDR_ATOMIC=1")
676         ENDIF()
678         LIST(APPEND OSG_GLOBAL_DEP_DEFS 
679                     "BOOST_COROUTINES_NO_DEPRECATION_WARNING")
681         IF(CMAKE_BUILD_TYPE STREQUAL "Debug" OR 
682            CMAKE_BUILD_TYPE STREQUAL "DebugOpt")
684           SET(OSG_BOOST_LIBS ${Boost_FILESYSTEM_LIBRARY_DEBUG} 
685                              ${Boost_SYSTEM_LIBRARY_DEBUG})
686         ELSE()
688           SET(OSG_BOOST_LIBS ${Boost_FILESYSTEM_LIBRARY_RELEASE} 
689                              ${Boost_SYSTEM_LIBRARY_RELEASE})
691         ENDIF()
693         SET(OSG_BOOST_INCDIRS ${Boost_INCLUDE_DIR})
695         OSG_ADD_OPT(BOOST_ROOT)
697         IF(WIN32)
699           SET(OSG_BOOST_TARGETS )
701           OSG_ADD_IMPORT_LIB(OSG_BOOST_TARGETS Boost_FILESYSTEM_LIBRARY)
702           OSG_ADD_IMPORT_LIB(OSG_BOOST_TARGETS Boost_SYSTEM_LIBRARY)
704           SET(OSG_BOOST_LIBS ${OSG_BOOST_TARGETS})
706         ENDIF(WIN32)
708         IF(APPLE)
709 #            IF(IOS)
710 #              FIND_PACKAGE(BoostIOS COMPONENTS system)
711 #            ELSE()
712               FIND_PACKAGE(Boost COMPONENTS system)
713 #            ENDIF()
715             IF(CMAKE_BUILD_TYPE STREQUAL "Debug" OR 
716                CMAKE_BUILD_TYPE STREQUAL "DebugOpt")
718               SET(OSG_BOOST_LIBS ${OSG_BOOST_LIBS} ${Boost_SYSTEM_LIBRARY_DEBUG})
720             ELSE()
722               SET(OSG_BOOST_LIBS ${OSG_BOOST_LIBS} ${Boost_SYSTEM_LIBRARY_RELEASE})
724             ENDIF()
726         ENDIF(APPLE)
728     ELSE(Boost_FOUND)
730         MESSAGE(SEND_ERROR "BOOST NOTFOUND." ${Boost_ERROR_REASON})
732         IF(NOT BOOST_ROOT)
733             SET(BOOST_ROOT "" CACHE PATH "")
734         ENDIF(NOT BOOST_ROOT)
736     ENDIF(Boost_FOUND)
738     IF(APPLE AND IOS)
739       set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
740       set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
741       set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
742     ENDIF(APPLE AND IOS)
744 ENDMACRO(OSG_CONFIGURE_BOOST)
746 ##############################################################################
747 # Boost
748 ##############################################################################
750 MACRO(OSG_ADD_QTMODULE OSG_QTMODULE OSG_QTMODULE_TARGET OSG_QTMODULE_OPTIONAL)
752     FIND_PACKAGE(${OSG_QTMODULE} QUIET)
754     STRING(TOUPPER ${OSG_QTMODULE} _OSG_QTMODULE_NAME_UP)
756 #    MESSAGE(STATUS "${_OSG_QTMODULE_NAME_UP} status : ${${OSG_QTMODULE}_FOUND}")
758     IF(${OSG_QTMODULE}_FOUND)
759       SET_TARGET_PROPERTIES(${OSG_QTMODULE_TARGET} 
760                             PROPERTIES MAP_IMPORTED_CONFIG_RELEASENOOPT "RELEASE")
761       SET_TARGET_PROPERTIES(${OSG_QTMODULE_TARGET}
762                             PROPERTIES MAP_IMPORTED_CONFIG_DEBUGOPT "DEBUG")
764       SET(OSG_QT_INC_DIR ${OSG_QT_INC_DIR};${${OSG_QTMODULE}_INCLUDE_DIRS})
765       SET(_OSG_QT_DEFS_COLLECT ${_OSG_QT_DEFS_COLLECT} ${${OSG_QTMODULE}_DEFINITIONS})
767       SET(OSG_QT_LIBS ${OSG_QT_LIBS};${${OSG_QTMODULE}_LIBRARIES})
769       SET(OSG_${_OSG_QTMODULE_NAME_UP}_MODULE_FOUND 1)
771     ELSE()
772       SET(OSG_${_OSG_QTMODULE_NAME_UP}_MODULE_FOUND 0)
774       IF(NOT ${OSG_QTMODULE_OPTIONAL})
775         SET(OSG_WITH_QT 0)
776         SET(QT5_FOUND   0)
777       ENDIF()
778     ENDIF()
780 ENDMACRO()
782 MACRO(OSG_CONFIGURE_QT)
783   IF(NOT QT5_CMAKE_DIR AND NOT QT5_BASE_DIR)
784     OSG_FIND_PACKAGE(Qt4)
786     IF(QT4_FOUND)
787         OSG_SET(OSG_WITH_QT 1)
788         OSG_SET(OSG_QT_INC_DIR ${QT_INCLUDE_DIR})
789         OSG_SET(OSG_QT_LIBS ${QT_LIBRARY_DIR})
791         OSG_SET(OSG_QT_DEFS "QT_THREAD_SUPPORT"
792                             "QT_ACCESSIBILITY_SUPPORT"
793                             "QT_CLEAN_NAMESPACE"
794                             "QT_CORE_LIB"
795                             "QT_GUI_LIB"
796                             "QT_OPENGL_LIB")
798         SET(OSG_QT_LIBS "")
800         IF(CMAKE_BUILD_TYPE STREQUAL "Debug" OR 
801            CMAKE_BUILD_TYPE STREQUAL "DebugOpt")
803           IF(QT_QTCORE_LIBRARY_DEBUG)
804             LIST(APPEND OSG_QT_LIBS ${QT_QTCORE_LIBRARY_DEBUG})
805           ELSE()
806             LIST(APPEND OSG_QT_LIBS ${QT_QTCORE_LIBRARY_RELEASE})
807           ENDIF()
809           IF(QT_QTGUI_LIBRARY_DEBUG)
810             LIST(APPEND OSG_QT_LIBS ${QT_QTGUI_LIBRARY_DEBUG})
811           ELSE()
812             LIST(APPEND OSG_QT_LIBS ${QT_QTGUI_LIBRARY_RELEASE})
813           ENDIF()
815           IF(QT_QTOPENGL_LIBRARY_DEBUG)
816             LIST(APPEND OSG_QT_LIBS ${QT_QTOPENGL_LIBRARY_DEBUG})
817           ELSE()
818             LIST(APPEND OSG_QT_LIBS ${QT_QTOPENGL_LIBRARY_RELEASE})
819           ENDIF()
821           IF(QT_QTSQL_LIBRARY_DEBUG)
822             LIST(APPEND OSG_QT_LIBS ${QT_QTSQL_LIBRARY_DEBUG})
823           ELSE()
824             LIST(APPEND OSG_QT_LIBS ${QT_QTSQL_LIBRARY_RELEASE})
825           ENDIF()
827         ELSE()
829           LIST(APPEND OSG_QT_LIBS ${QT_QTCORE_LIBRARY_RELEASE})
830           LIST(APPEND OSG_QT_LIBS ${QT_QTGUI_LIBRARY_RELEASE})
831           LIST(APPEND OSG_QT_LIBS ${QT_QTOPENGL_LIBRARY_RELEASE})
832           LIST(APPEND OSG_QT_LIBS ${QT_QTSQL_LIBRARY_RELEASE})
834         ENDIF()
837         IF(WIN32)
838           OSG_ADD_IMPORT_LIB(QT_TARGETS QT_QTCORE_LIBRARY)
839           OSG_ADD_IMPORT_LIB(QT_TARGETS QT_QTGUI_LIBRARY)
840           OSG_ADD_IMPORT_LIB(QT_TARGETS QT_QTOPENGL_LIBRARY)
842           OSG_SET(OSG_QT_LIBS "${QT_TARGETS}")
843         ENDIF(WIN32)
845 #        OSG_ADD_OPT(QT4_FOUND)
846         OSG_ADD_OPT(QT_QMAKE_EXECUTABLE)
848     ELSE(QT4_FOUND)
849         OSG_SET(OSG_QT_INC_DIR "")
850         OSG_SET(OSG_QT_LIBS "")
851     ENDIF(QT4_FOUND)
852   ELSE()
854     IF(QT5_CMAKE_DIR)
855       SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QT5_CMAKE_DIR})
856     ELSE()
857       IF(CMAKE_BUILD_TYPE STREQUAL "Debug" OR
858          CMAKE_BUILD_TYPE STREQUAL "DebugGV")
859         SET(_OSG_QT5LIBSUFFIX          ".dbg")
860         SET(_OSG_QT5LIBSUFFIX_FALLBACK ".opt")
861       ELSE()
862         SET(_OSG_QT5LIBSUFFIX          ".opt")
863         SET(_OSG_QT5LIBSUFFIX_FALLBACK ".dbg")
864       ENDIF()
866       IF(EXISTS ${QT5_BASE_DIR}/lib${_OSG_QT5LIBSUFFIX}/cmake)
867         SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QT5_BASE_DIR}/lib${_OSG_QT5LIBSUFFIX}/cmake)
868       ELSEIF(EXISTS ${QT5_BASE_DIR}/lib/cmake)
869         SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QT5_BASE_DIR}/lib/cmake)
870       ELSE()
871         IF(NOT WIN32)
872           IF(EXISTS ${QT5_BASE_DIR}/lib${_OSG_QT5LIBSUFFIX_FALLBACK}/cmake)
873             SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QT5_BASE_DIR}/lib${_OSG_QT5LIBSUFFIX_FALLBACK}/cmake)
874             MESSAGE(STATUS "QT5_BASE_DIR using fallback suffix")
875           ELSE()
876             MESSAGE(FATAL_ERROR "QT5_BASE_DIR set but cmake dir can not be found")
877           ENDIF()
878         ELSE()
879           MESSAGE(FATAL_ERROR "QT5_BASE_DIR set but cmake dir can not be found")
880         ENDIF()
881       ENDIF()
882     ENDIF()
884     OSG_SET(OSG_WITH_QT 1)
885     OSG_SET(QT5_FOUND 1)
887     OSG_SET(OSG_QT_INC_DIR "")
888     OSG_SET(OSG_QT_LIBS "")
889     OSG_SET(OSG_QT_DEFS OSG_WITH_QT5=1)
891     IF(WIN32)
892       SET(_OSG_QT_DEFS_COLLECT -DOSG_GLES2_POINTERDEF -DGLdouble=GLdouble)
893     ELSE()
894       SET(_OSG_QT_DEFS_COLLECT "")
895     ENDIF(WIN32)
897     OSG_ADD_QTMODULE(Qt5Core          Qt5::Core          FALSE)
898     OSG_ADD_QTMODULE(Qt5Gui           Qt5::Gui           FALSE)
899     OSG_ADD_QTMODULE(Qt5Widgets       Qt5::Widgets       FALSE)
900     OSG_ADD_QTMODULE(Qt5OpenGL        Qt5::OpenGL        FALSE)
901     OSG_ADD_QTMODULE(Qt5Network       Qt5::Network       TRUE )
902     OSG_ADD_QTMODULE(Qt5WebKit        Qt5::WebKit        TRUE )
903     OSG_ADD_QTMODULE(Qt5Qml           Qt5::Qml           TRUE )
904     OSG_ADD_QTMODULE(Qt5PrintSupport  Qt5::PrintSupport  TRUE )
905     OSG_ADD_QTMODULE(Qt5Quick         Qt5::Quick         TRUE )
906     OSG_ADD_QTMODULE(Qt5WebKitWidgets Qt5::WebKitWidgets TRUE )
908     IF(${OSG_QT5GUI_MODULE_FOUND})
909       SET(OSG_QT_INC_DIR ${OSG_QT_INC_DIR};${Qt5Gui_PRIVATE_INCLUDE_DIRS})
910     ENDIF()
912     IF(OSG_QT_INC_DIR)
913     LIST(REMOVE_DUPLICATES OSG_QT_INC_DIR)
914     ENDIF()
917     FOREACH(_QT_DEF ${_OSG_QT_DEFS_COLLECT})
918       STRING(REPLACE "-D" "" _QT_DEF_STRIPPED ${_QT_DEF})
919       LIST(APPEND OSG_QT_DEFS ${_QT_DEF_STRIPPED})
920     ENDFOREACH()
922     IF(OSG_WITH_QT)
923       OSG_SET(OSG_WITH_QT5 1)
925       IF(QT5_CMAKE_DIR)
926         OSG_ADD_OPT(QT5_CMAKE_DIR)
927       ELSEIF(QT5_BASE_DIR)
928         OSG_ADD_OPT(QT5_BASE_DIR)
929       ENDIF()
930     ENDIF()
932 #    MESSAGE(STATUS "BAR ${OSG_QT_INC_DIR} ${OSG_QT_LIBS} ${OSG_QT_DEFS}")
933 #    MESSAGE(STATUS "BAR ${OSG_QT_DEFS}")
935 #    MESSAGE(STATUS "FOO ${Qt5Core_FOUND} ${Qt5Core_DEFINITIONS} ${Qt5Core_LIBRARIES}")
936 #    MESSAGE(FATAL_ERROR "FOO ${QT5_FOUND} ${OSG_WITH_QT}")
938   ENDIF()
939 ENDMACRO(OSG_CONFIGURE_QT)
941 ##############################################################################
942 # Glew
943 ##############################################################################
945 MACRO(OSG_CONFIGURE_GLEW)
947   IF(OSG_USE_OSGSUPPORT_LIBS)
949     IF(EXISTS ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/GL/glew.h)
950       SET(GLEW_INCLUDE_DIR ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR} CACHE PATH "" FORCE)
951     ENDIF()
953 #      IF(OSG_USE_STATIC_SUPPORT_LIBS)
954 #        IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgglew.lib)
955 #          SET(GLEW_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgglew.lib)
956 #        ENDIF()
957 #        IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgglewD.lib)
958 #          SET(GLEW_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgglewD.lib)
959 #        ENDIF()
960 #      ELSE()
961 #      ENDIF()
963     IF(WIN32)
964       IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgglew.lib)
965         SET(GLEW_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/osgglew.lib)
966       ENDIF()
967       IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgglewD.lib)
968         SET(GLEW_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/osgglewD.lib)
969       ENDIF()
970     ELSE(WIN32)
971       IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgglew${CMAKE_SHARED_LIBRARY_SUFFIX})
972         SET(GLEW_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgglew${CMAKE_SHARED_LIBRARY_SUFFIX})
973       ENDIF()
974       IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgglew${CMAKE_SHARED_LIBRARY_SUFFIX})
975         SET(GLEW_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgglew${CMAKE_SHARED_LIBRARY_SUFFIX})
976       ENDIF()
977     ENDIF(WIN32)
979     IF(GLEW_INCLUDE_DIR)
980       IF(GLEW_LIBRARY_DEBUG OR GLEW_LIBRARY_RELEASE)
981         SET(GLEW_FOUND TRUE)
982       ENDIF()
983     ENDIF()
985     IF(GLEW_FOUND)
986       OSG_ADD_IMPORT_LIB(OSG_GLEW_TARGETS GLEW_LIBRARY)
987       SET(GLEW_LIBRARIES ${OSG_GLEW_TARGETS} CACHE STRING "" FORCE)
989       OSG_ADD_OPT(GLEW_INCLUDE_DIR)
990       OSG_ADD_OPT(GLEW_LIBRARIES)
991       OSG_ADD_OPT(GLEW_FOUND)
992     ENDIF(GLEW_FOUND)
994   ENDIF(OSG_USE_OSGSUPPORT_LIBS)
996   IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT GLEW_FOUND)
998     IF(WIN32)
999       OSG_FIND_PACKAGE(GLEW_OpenSG)
1001       IF(GLEW_FOUND)
1002         OSG_ADD_IMPORT_LIB(OSG_GLEW_TARGETS GLEW_LIBRARY)
1003         SET(GLEW_LIBRARIES ${OSG_GLEW_TARGETS} CACHE STRING "" FORCE)
1005         OSG_ADD_OPT(GLEW_INCLUDE_DIR)
1006         OSG_ADD_OPT(GLEW_LIBRARIES)
1007       ENDIF(GLEW_FOUND)
1009     ENDIF()
1011     IF(NOT GLEW_FOUND AND GLEW_INCLUDE_DIR AND GLEW_LIBRARIES)
1012       SET(GLEW_FOUND TRUE)
1013       OSG_ADD_OPT(GLEW_FOUND)
1014     ENDIF()
1016   ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT GLEW_FOUND)
1018 ENDMACRO(OSG_CONFIGURE_GLEW)
1020 ##############################################################################
1021 # LibMini
1022 ##############################################################################
1024 MACRO(OSG_CONFIGURE_LIBMINI)
1026     IF(OSG_USE_OSGSUPPORT_LIBS)
1028         IF(EXISTS ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/mini/mini.h)
1029             SET(OSG_LIBMINI_INCLUDE_DIR ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR} CACHE PATH "" FORCE)
1030         ENDIF()
1032         SET(OSG_LIBMINI_LIBRARY_RELEASE "" CACHE INTERNAL "" FORCE)
1033         SET(OSG_LIBMINI_LIBRARY_DEBUG  "" CACHE INTERNAL "" FORCE)
1034         SET(OSG_LIBMINI_FOUND FALSE CACHE INTERNAL "" FORCE)
1036         IF(UNIX)
1038           IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgmini.a)
1039             SET(OSG_LIBMINI_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgmini.a)
1040           ENDIF()
1041           IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgmini.a)
1042             SET(OSG_LIBMINI_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgmini.a)
1043           ENDIF()
1045         ELSEIF(WIN32)
1047           IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgmini.lib)
1048               SET(OSG_LIBMINI_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgmini.lib)
1049           ENDIF()
1050           IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgminiD.lib)
1051               SET(OSG_LIBMINI_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgminiD.lib)
1052           ENDIF()
1054         ENDIF()
1056         IF(OSG_LIBMINI_INCLUDE_DIR)
1057             IF(OSG_LIBMINI_LIBRARY_DEBUG OR OSG_LIBMINI_LIBRARY_RELEASE)
1058                 SET(OSG_LIBMINI_FOUND TRUE CACHE INTERNAL "" FORCE)
1059             ENDIF()
1060         ENDIF()
1062         IF(OSG_LIBMINI_FOUND)
1063           OSG_ADD_IMPORT_LIB(OSG_LIBMINI_TARGETS OSG_LIBMINI_LIBRARY)
1064           SET(OSG_LIBMINI_LIBRARIES ${OSG_LIBMINI_TARGETS} CACHE STRING "" FORCE)
1065         ENDIF(OSG_LIBMINI_FOUND)
1067     ENDIF(OSG_USE_OSGSUPPORT_LIBS)
1069     IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT OSG_LIBMINI_FOUND)
1071       IF(WIN32)
1072         OSG_FIND_PACKAGE(LibMini_OpenSG)
1074         IF(OSG_LIBMINI_FOUND)
1075           OSG_ADD_IMPORT_LIB(OSG_LIBMINI_TARGETS OSG_LIBMINI_LIBRARY)
1077           SET(OSG_LIBMINI_LIBRARIES ${OSG_LIBMINI_TARGETS} CACHE STRING "" FORCE)
1078         ENDIF(OSG_LIBMINI_FOUND)
1080       ELSE(WIN32)
1081         OSG_FIND_PACKAGE(LibMini_OpenSG)
1082       ENDIF(WIN32)
1084     ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT OSG_LIBMINI_FOUND)
1086     IF(OSG_LIBMINI_FOUND)
1087         OSG_SET(OSG_WITH_LIBMINI 1)
1088     ENDIF(OSG_LIBMINI_FOUND)
1090 ENDMACRO(OSG_CONFIGURE_LIBMINI)
1092 ##############################################################################
1093 # AntTweakBar
1094 ##############################################################################
1096 MACRO(OSG_CONFIGURE_ANTTWEAKBAR)
1098     IF(OSG_USE_OSGSUPPORT_LIBS)
1099         IF(EXISTS ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/AntTweakBar/include/AntTweakBar.h)
1100             SET(ANTTWEAKBAR_INCLUDE_DIR ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/AntTweakBar/include CACHE PATH "" FORCE)
1101         ENDIF()
1103         SET(ANTTWEAKBAR_LIBRARY_RELEASE "" CACHE INTERNAL "" FORCE)
1104         SET(ANTTWEAKBAR_LIBRARY_DEBUG  "" CACHE INTERNAL "" FORCE)
1105         SET(ANTTWEAKBAR_FOUND FALSE CACHE INTERNAL "" FORCE)
1107         IF(UNIX)
1109           IF(OSG_PLATFORM_64)
1110               IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libanttweakbar64.a)
1111                 SET(ANTTWEAKBAR_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libanttweakbar64.a)
1112               ENDIF()
1113               IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgmini64.a)
1114                 SET(ANTTWEAKBAR_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libanttweakbar64.a)
1115               ENDIF()
1116           ELSE()
1117               IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libanttweakbar.a)
1118                 SET(ANTTWEAKBAR_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libanttweakbar.a)
1119               ENDIF()
1120               IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgmini.a)
1121                 SET(ANTTWEAKBAR_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libanttweakbar.a)
1122               ENDIF()
1123           ENDIF()
1125         ELSEIF(WIN32)
1127           IF(OSG_PLATFORM_64)
1128               IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/AntTweakBar64.lib)
1129                   SET(ANTTWEAKBAR_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/AntTweakBar64.lib)
1130               ENDIF()
1131               IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/AntTweakBar64.lib)
1132                   SET(ANTTWEAKBAR_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/AntTweakBar64.lib)
1133               ENDIF()
1134           ELSE()
1135               IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/AntTweakBar.lib)
1136                   SET(ANTTWEAKBAR_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/AntTweakBar.lib)
1137               ENDIF()
1138               IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/AntTweakBar.lib)
1139                   SET(ANTTWEAKBAR_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/AntTweakBar.lib)
1140               ENDIF()
1141           ENDIF()
1143         ENDIF()
1145         IF(ANTTWEAKBAR_INCLUDE_DIR)
1146             IF(ANTTWEAKBAR_LIBRARY_DEBUG OR ANTTWEAKBAR_LIBRARY_RELEASE)
1147                 SET(ANTTWEAKBAR_FOUND TRUE CACHE INTERNAL "" FORCE)
1148             ENDIF()
1149         ENDIF()
1151         IF(ANTTWEAKBAR_FOUND)
1152           OSG_ADD_IMPORT_LIB(ANTTWEAKBAR_TARGETS ANTTWEAKBAR_LIBRARY)
1153           SET(ANTTWEAKBAR_LIBRARIES ${ANTTWEAKBAR_TARGETS} CACHE STRING "" FORCE)
1154         ENDIF(ANTTWEAKBAR_FOUND)
1156     ENDIF(OSG_USE_OSGSUPPORT_LIBS)
1158     IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT ANTTWEAKBAR_FOUND)
1159       IF(WIN32)
1160         OSG_FIND_PACKAGE(AntTweakBar_OpenSG)
1162         IF(ANTTWEAKBAR_FOUND)
1163           OSG_ADD_IMPORT_LIB(ANTTWEAKBAR_TARGETS ANTTWEAKBAR_LIBRARY)
1165           SET(ANTTWEAKBAR_LIBRARIES ${ANTTWEAKBAR_TARGETS} CACHE STRING "" FORCE)
1166         ENDIF(ANTTWEAKBAR_FOUND)
1168       ELSE(WIN32)
1169         OSG_FIND_PACKAGE(AntTweakBar_OpenSG)
1170       ENDIF(WIN32)
1172     ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT ANTTWEAKBAR_FOUND)
1174     IF(ANTTWEAKBAR_FOUND)
1175         OSG_SET(OSG_WITH_ANTTWEAKBAR 1)
1176     ENDIF(ANTTWEAKBAR_FOUND)
1178 ENDMACRO(OSG_CONFIGURE_ANTTWEAKBAR)
1180 ##############################################################################
1181 # Qhull
1182 ##############################################################################
1184 MACRO(OSG_CONFIGURE_QHULL)
1186     IF(OSG_USE_OSGSUPPORT_LIBS)
1187         # ToDo
1188     ENDIF(OSG_USE_OSGSUPPORT_LIBS)
1190     IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT QHULL_FOUND)
1191         OSG_FIND_PACKAGE(Qhull_OpenSG)
1192     ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT QHULL_FOUND)
1194     IF(QHULL_FOUND)
1195         OSG_SET(OSG_WITH_QHULL 1)
1196     ENDIF(QHULL_FOUND)
1198 ENDMACRO(OSG_CONFIGURE_QHULL)
1200 ##############################################################################
1201 # VTK
1202 ##############################################################################
1204 MACRO(OSG_CONFIGURE_VTK)
1205     OSG_SET(VTK_NO_LIBRARY_DEPENDS TRUE)
1206     FIND_PACKAGE(VTK)
1208     IF(VTK_FOUND)
1209         OSG_SET(OSG_WITH_VTK 1)
1211         SET(OSG_VTK_LIBS )
1213         SET(VTK_GRAPHICS_OSGLIB_RELEASE )
1214         SET(VTK_GRAPHICS_OSGLIB_DEBUG )
1216         SET(VTK_RENDERING_OSGLIB_RELEASE )
1217         SET(VTK_RENDERING_OSGLIB_DEBUG )
1219         SET(VTK_COMMON_OSGLIB_RELEASE )
1220         SET(VTK_COMMON_OSGLIB_DEBUG )
1222         SET(VTK_FILTERING_OSGLIB_RELEASE )
1223         SET(VTK_FILTERING_OSGLIB_DEBUG )
1225         SET(VTK_IO_OSGLIB_RELEASE )
1226         SET(VTK_IO_OSGLIB_DEBUG )
1229         IF(EXISTS ${VTK_LIBRARY_DIRS}/vtkGraphics.lib)
1230           SET(VTK_GRAPHICS_OSGLIB_RELEASE ${VTK_LIBRARY_DIRS}/vtkGraphics.lib)
1231         ENDIF()
1232         IF(EXISTS ${VTK_LIBRARY_DIRS}/vtkGraphicsD.lib)
1233           SET(VTK_GRAPHICS_OSGLIB_DEBUG ${VTK_LIBRARY_DIRS}/vtkGraphicsD.lib)
1234         ENDIF()
1237         IF(EXISTS ${VTK_LIBRARY_DIRS}/vtkRendering.lib)
1238           SET(VTK_RENDERING_OSGLIB_RELEASE ${VTK_LIBRARY_DIRS}/vtkRendering.lib)
1239         ENDIF()
1240         IF(EXISTS ${VTK_LIBRARY_DIRS}/vtkRenderingD.lib)
1241           SET(VTK_RENDERING_OSGLIB_DEBUG ${VTK_LIBRARY_DIRS}/vtkRenderingD.lib)
1242         ENDIF()
1245         IF(EXISTS ${VTK_LIBRARY_DIRS}/vtkCommon.lib)
1246           SET(VTK_COMMON_OSGLIB_RELEASE ${VTK_LIBRARY_DIRS}/vtkCommon.lib)
1247         ENDIF()
1248         IF(EXISTS ${VTK_LIBRARY_DIRS}/vtkCommonD.lib)
1249           SET(VTK_COMMON_OSGLIB_DEBUG ${VTK_LIBRARY_DIRS}/vtkCommonD.lib)
1250         ENDIF()
1253         IF(EXISTS ${VTK_LIBRARY_DIRS}/vtkFiltering.lib)
1254           SET(VTK_FILTERING_OSGLIB_RELEASE ${VTK_LIBRARY_DIRS}/vtkFiltering.lib)
1255         ENDIF()
1256         IF(EXISTS ${VTK_LIBRARY_DIRS}/vtkFilteringD.lib)
1257           SET(VTK_FILTERING_OSGLIB_DEBUG ${VTK_LIBRARY_DIRS}/vtkFilteringD.lib)
1258         ENDIF()
1261         IF(EXISTS ${VTK_LIBRARY_DIRS}/vtkIO.lib)
1262           SET(VTK_IO_OSGLIB_RELEASE ${VTK_LIBRARY_DIRS}/vtkIO.lib)
1263         ENDIF()
1264         IF(EXISTS ${VTK_LIBRARY_DIRS}/vtkIOD.lib)
1265           SET(VTK_IO_OSGLIB_DEBUG ${VTK_LIBRARY_DIRS}/vtkIOD.lib)
1266         ENDIF()
1268         OSG_ADD_IMPORT_LIB(OSG_VTK_LIBS VTK_GRAPHICS_OSGLIB)
1269         OSG_ADD_IMPORT_LIB(OSG_VTK_LIBS VTK_RENDERING_OSGLIB)
1270         OSG_ADD_IMPORT_LIB(OSG_VTK_LIBS VTK_COMMON_OSGLIB)
1271         OSG_ADD_IMPORT_LIB(OSG_VTK_LIBS VTK_FILTERING_OSGLIB)
1272         OSG_ADD_IMPORT_LIB(OSG_VTK_LIBS VTK_IO_OSGLIB)
1274 #        OSG_ADD_OPT(OSG_VTK_LIBS)
1275         OSG_ADD_OPT(VTK_LIBRARY_DIRS)
1276         OSG_ADD_OPT(VTK_INCLUDE_DIRS)
1277         OSG_ADD_OPT(VTK_DIR)
1278     ENDIF(VTK_FOUND)
1279 ENDMACRO(OSG_CONFIGURE_VTK)
1281 ##############################################################################
1282 # EXPAT
1283 ##############################################################################
1285 MACRO(OSG_CONFIGURE_EXPAT)
1287     IF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
1289       IF(EXISTS ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR}/expat.h)
1290         SET(EXPAT_INCLUDE_DIR ${OSG_SUPPORT_ROOT}/include${OSG_SUPPORT_INC_SUBDIR} CACHE PATH "" FORCE)
1291       ENDIF()
1293       IF(OSG_USE_STATIC_SUPPORT_LIBS)
1294         IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgexpat.lib)
1295           SET(EXPAT_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgexpat.lib)
1296         ENDIF()
1297           IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgexpatD.lib)
1298             SET(EXPAT_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgexpatD.lib)
1299           ENDIF()
1300         ELSE()
1301           IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgexpat.lib)
1302             SET(EXPAT_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/osgexpat.lib)
1303           ENDIF()
1304           IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgexpatD.lib)
1305             SET(EXPAT_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/osgexpatD.lib)
1306           ENDIF()
1307         ENDIF()
1309         IF(EXPAT_INCLUDE_DIR)
1310           IF(EXPAT_LIBRARY_DEBUG OR EXPAT_LIBRARY_RELEASE)
1311             SET(EXPAT_FOUND TRUE)
1312           ENDIF()
1313         ENDIF()
1315         IF(EXPAT_FOUND)
1316           OSG_ADD_IMPORT_LIB(OSG_EXPAT_TARGETS EXPAT_LIBRARY)
1317           SET(EXPAT_LIBRARIES ${OSG_EXPAT_TARGETS} CACHE STRING "" FORCE)
1318         ENDIF(EXPAT_FOUND)
1320     ENDIF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
1322     IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT EXPAT_FOUND)
1323         OSG_FIND_PACKAGE(Expat_OpenSG)
1325         IF(EXPAT_FOUND)
1326           OSG_ADD_IMPORT_LIB(OSG_EXPAT_TARGETS EXPAT_LIBRARY)
1328           SET(EXPAT_LIBRARIES ${OSG_EXPAT_TARGETS} CACHE STRING "" FORCE)
1329         ENDIF(EXPAT_FOUND)
1330     ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT EXPAT_FOUND)
1332 ENDMACRO(OSG_CONFIGURE_EXPAT)
1335 ##############################################################################
1336 # OSG_ADD_GLUTPACKAGE
1337 ##############################################################################
1339 MACRO(OSG_ADD_GLUTPACKAGE OSG_DO_SETUP_TEST)
1340   IF("${OSG_DO_SETUP_TEST}" STREQUAL "ON" OR "${OSG_DO_SETUP_TEST}" STREQUAL "TRUE")
1341     SET(${PROJECT_NAME}_DEP_TEST_INCDIR ${${PROJECT_NAME}_DEP_TEST_INCDIR} OSG_GLUT_INC_DIR)
1342     SET(${PROJECT_NAME}_DEP_TEST_LIB    ${${PROJECT_NAME}_DEP_TEST_LIB}    GLUT_LIBRARIES)
1343     IF(OSG1_PROJECT)
1344       SET(${PROJECT_NAME}_DEP_TEST_DEFS ${${PROJECT_NAME}_DEP_TEST_DEFS};OSG_WITH_GLUT)
1345     ENDIF()
1347 #    IF(OSG_USE_OSGSUPPORT_LIBS AND OSG_USE_STATIC_SUPPORT_LIBS)
1348 #      SET(${PROJECT_NAME}_DEP_TEST_LIB ${${PROJECT_NAME}_DEP_TEST_LIB} GLUT_LIBRARIES)
1349 #      SET(${PROJECT_NAME}_DEP_TEST_DEFS ${${PROJECT_NAME}_DEP_TEST_DEFS};FREEGLUT_STATIC)
1350 #    ENDIF()
1351   ELSE()
1352     SET(${PROJECT_NAME}_DEP_INCDIR ${${PROJECT_NAME}_DEP_INCDIR} OSG_GLUT_INC_DIR)
1353     SET(${PROJECT_NAME}_DEP_LIB    ${${PROJECT_NAME}_DEP_LIB}    GLUT_LIBRARIES)
1354     IF(OSG1_PROJECT)
1355       SET(${PROJECT_NAME}_DEP_DEFS ${${PROJECT_NAME}_DEP_DEFS};OSG_WITH_GLUT)
1356     ENDIF()
1358 #    IF(OSG_USE_OSGSUPPORT_LIBS AND OSG_USE_STATIC_SUPPORT_LIBS)
1359 #      SET(${PROJECT_NAME}_DEP_DEFS ${${PROJECT_NAME}_DEP_DEFS};FREEGLUT_STATIC)
1360 #    ENDIF()
1361   ENDIF()
1362 ENDMACRO(OSG_ADD_GLUTPACKAGE SETUP_TEST)
1364 ##############################################################################
1365 # OSG_ADD_GLEWPACKAGE
1366 ##############################################################################
1368 MACRO(OSG_ADD_GLEWPACKAGE OSG_DO_SETUP_TEST)
1369   IF("${OSG_DO_SETUP_TEST}" STREQUAL "ON" OR "${OSG_DO_SETUP_TEST}" STREQUAL "TRUE")
1370     SET(${PROJECT_NAME}_DEP_TEST_INCDIR ${${PROJECT_NAME}_DEP_TEST_INCDIR} GLEW_INCLUDE_DIR)
1372     IF(OSG_USE_OSGSUPPORT_LIBS)
1373       SET(${PROJECT_NAME}_DEP_TEST_LIB ${${PROJECT_NAME}_DEP_TEST_LIB} GLEW_LIBRARIES)
1374     ENDIF(OSG_USE_OSGSUPPORT_LIBS)
1376     IF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
1377       SET(${PROJECT_NAME}_DEP_TEST_LIB ${${PROJECT_NAME}_DEP_TEST_LIB} GLEW_LIBRARIES)
1378 #      IF(AND OSG_USE_STATIC_SUPPORT_LIBS)
1379 #        SET(${PROJECT_NAME}_DEP_TEST_DEFS ${${PROJECT_NAME}_DEP_TEST_DEFS};GLEW_STATIC)
1380 #      ELSE()
1381 #        SET(${PROJECT_NAME}_DEP_TEST_DEFS ${${PROJECT_NAME}_DEP_TEST_DEFS};GLEW_BUILD)
1382 #      ENDIF()
1383     ENDIF()
1384   ELSE()
1385     SET(${PROJECT_NAME}_DEP_INCDIR ${${PROJECT_NAME}_DEP_INCDIR} GLEW_INCLUDE_DIR)
1387     IF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
1388       SET(${PROJECT_NAME}_DEP_LIB ${${PROJECT_NAME}_DEP_LIB} GLEW_LIBRARIES)
1389     ENDIF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)
1391 #    IF(OSG_USE_OSGSUPPORT_LIBS AND WIN32 AND OSG_USE_STATIC_SUPPORT_LIBS)
1392 #      SET(${PROJECT_NAME}_DEP_DEFS ${${PROJECT_NAME}_DEP_DEFS};GLEW_STATIC)
1393 #    ELSE()
1394 #      SET(${PROJECT_NAME}_DEP_DEFS ${${PROJECT_NAME}_DEP_DEFS};GLEW_BUILD)
1395 #    ENDIF()
1396   ENDIF()
1397 ENDMACRO(OSG_ADD_GLEWPACKAGE SETUP_TEST)