1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
5 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${OpenSG_SOURCE_DIR}/CMake")
7 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${OpenSG_SOURCE_DIR}/CMake/IOS")
11 # Diable boost cmake config, as it screws up OpenSG's boost config
13 SET(Boost_NO_BOOST_CMAKE TRUE CACHE INTERNAL "" FORCE)
15 ##############################################
16 # Initial cache to make life easier on Windows
17 ##############################################
19 IF(NOT _OSGINITCACHELOADED AND EXISTS ${CMAKE_SOURCE_DIR}/CMakeCacheInitial.txt AND NOT OSG_BUILD_DEPENDEND)
20 INCLUDE(${CMAKE_SOURCE_DIR}/CMakeCacheInitial.txt)
21 SET(_OSGINITCACHELOADED TRUE CACHE INTERNAL "")
22 ENDIF(NOT _OSGINITCACHELOADED AND EXISTS ${CMAKE_SOURCE_DIR}/CMakeCacheInitial.txt AND NOT OSG_BUILD_DEPENDEND)
25 INCLUDE(BuildFunctions)
27 ##########################
28 # Disallow in-source build
29 ##########################
31 IF("${OpenSG_SOURCE_DIR}" STREQUAL "${OpenSG_BINARY_DIR}")
32 MESSAGE(FATAL_ERROR "OpenSG requires an out of source Build. \n"
33 "Please create a separate binary directory and run "
35 ENDIF("${OpenSG_SOURCE_DIR}" STREQUAL "${OpenSG_BINARY_DIR}")
37 SET(OSG_BUILD_ACTIVE TRUE)
39 ##############################################################################
41 ##############################################################################
44 IF(OSG_BUILD_DEPENDEND)
45 # Hide it from further manipulation
46 SET(OSG_BUILD_DEPENDEND ${OSG_BUILD_DEPENDEND} CACHE INTERNAL "")
47 ENDIF(OSG_BUILD_DEPENDEND)
50 OPTION(OSG_VERBOSE_BUILD_MESSAGES "Print verbose messages when generating the build system" OFF)
51 MARK_AS_ADVANCED(OSG_VERBOSE_BUILD_MESSAGES)
53 OSG_OPTION(BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON)
55 OSG_OPTION(OSGBUILD_TESTS "Build test programs" ON)
56 OSG_OPTION(OSGBUILD_UNITTESTS "Build/run unit test programs" OFF)
57 OSG_OPTION(OSGBUILD_EXAMPLES_SIMPLE "Build example programs during system build" OFF)
58 OSG_OPTION(OSGBUILD_EXAMPLES_ADVANCED "Build advanced example programs during system build" OFF)
59 OSG_OPTION(OSGBUILD_EXAMPLES_TUTORIAL "Build tutorial example programs during system build" OFF)
60 OSG_OPTION(OSGBUILD_PYTHON_BINDINGS "Build python bindings" OFF)
61 OSG_OPTION(OSGBUILD_PYTHON_DUMP_DECLS "Dump decls while building python" FALSE)
63 OSG_OPTION(OSGEXCLUDE_TESTS_FROM_ALL "Exclude test programs from all target" OFF)
64 OSG_OPTION(OSGEXCLUDE_UNITTESTS_FROM_ALL "Build/run unit test programs" OFF)
65 OSG_OPTION(OSGEXCLUDE_EXAMPLES_SIMPLE_FROM_ALL "Build example programs during system build" OFF)
66 OSG_OPTION(OSGEXCLUDE_EXAMPLES_ADVANCED_FROM_ALL "Build advanced example programs during system build" OFF)
68 OSG_OPTION(OSGBUILD_ENABLE_PACKAGING "Generate binary packages with CPack" OFF)
69 SET(OSGBUILD_PACKAGE_TYPE "" CACHE STRING
70 "The type of package to generate (empty->default)")
72 OSG_OPTION(OSG_ENABLE_NEW_SHADER "" ON)
73 OSG_OPTION(OSG_ENABLE_OGL2_SHADERFUNCTIONS "" ON)
74 OSG_OPTION(OSG_ENABLE_OGL_VERTEXATTRIB_FUNCS "" OFF)
75 OSG_OPTION(OSG_ENABLE_NEW_GEOHANDLER "" OFF)
76 OSG_OPTION(OSG_ENABLE_OGL_COREONLY "" OFF)
77 OSG_OPTION(OSG_ENABLE_OGL_ES2 "" OFF)
78 OSG_OPTION(OSG_ENABLE_OGL_ES2_SIMGL3 "" OFF)
79 OSG_OPTION(OSG_ENABLE_CSM_WIN7_FEATURES "" OFF)
81 OSG_OPTION(OSG_ENABLE_OGL3_PROTOS "" OFF)
82 OSG_OPTION(OSG_ENABLE_OGL4_PROTOS "" OFF)
83 OSG_OPTION(OSG_ENABLE_OGLES_PROTOS "" OFF)
85 OSG_OPTION(OSG_ENABLE_GL_INCLUDE_GLEW "" OFF)
87 OSG_SET_CACHE(OSG_SHADER_CACHE_MODE 5 STRING "")
89 OSG_OPTION(OSG_ENABLE_FCD2CODE "" OFF)
90 OSG_OPTION(OSG_FCD2CODE_WRITE_CLASS "Write class file during cmake run if only
91 the fcd file is found" OFF)
92 OSG_OPTION(OSG_ENABLE_SCANPARSE_REGEN "" OFF)
94 OSG_OPTION(OSG_ENABLE_GLDEFINE_MAPPER "" ON)
95 OSG_OPTION(OSG_ENABLE_NEW_OSB_IO "" ON)
97 OSG_OPTION(OSG_ENABLE_SSE2 "" ON)
98 OSG_OPTION(OSG_USE_OSG2_NAMESPACE "" OFF)
99 OSG_OPTION(OSG_ENABLE_CUDA "Build OpenSG with CUDA support" ON)
101 OSG_OPTION(OSG_ENABLE_TESTCONTAINER "" OFF)
102 OSG_OPTION(OSG_ENABLE_VALGRIND_CHECKS "" OFF)
103 OSG_OPTION(OSG_ENABLE_MEMORY_DEBUGGING "" OFF)
104 OSG_OPTION(OSG_ENABLE_DOUBLE_MATRIX_STACK "" OFF)
105 OSG_OPTION(OSG_ENABLE_DEFAULT_READONLY_CHANGELIST "" OFF)
106 OSG_OPTION(OSG_ENABLE_PAR_PARTITION_DRAWING "" OFF)
107 OSG_OPTION(OSG_DISABLE_SOURCE_GROUPS "" OFF)
108 OSG_OPTION(OSG_ENABLE_WRITE_PYTHON_TO_SOURCE "" OFF)
110 OSG_SET_CACHE(OSG_PYTHON_MODULE_BASE_DIR "" PATH "")
113 OPTION(OSG_ENABLE_WIN_LOCALSTORAGE "" ON)
114 OPTION(OSG_DISABLE_MICROSOFT_SECURE_CXXX "" OFF)
116 IF(OSG_DISABLE_MICROSOFT_SECURE_CXXX)
117 OPTION(OSG_DISABLE_MS_ITERATOR_DEBUGGING "" ON)
118 ELSE(OSG_DISABLE_MICROSOFT_SECURE_CXXX)
119 OPTION(OSG_DISABLE_MS_ITERATOR_DEBUGGING "" OFF)
120 ENDIF(OSG_DISABLE_MICROSOFT_SECURE_CXXX)
122 OPTION(OSG_ENABLE_ELF_LOCALSTORAGE "" OFF)
124 OPTION(OSG_ENABLE_ELF_LOCALSTORAGE "" ON)
127 OPTION(OSG_ENABLE_AUTOINIT_THREADS "" OFF)
130 OSG_OPTION(OSG_USE_SEPARATE_LIBDIRS "" ON)
131 OSG_OPTION(OSG_INSTALL_PDB_FILES "" OFF)
134 OSG_OPTION(OSG_INSTALL_EXAMPLES "" OFF)
135 OSG_OPTION(OSG_INSTALL_EXAMPLE_EXE "" OFF)
136 OSG_OPTION(OSG_INSTALL_APPS "" ON)
138 OSG_OPTION(OSGCOMPAT_ENABLE "" OFF)
139 OSG_OPTION(OSGCOMPAT_ENABLE_DEPRECATED "" OFF)
140 OSG_OPTION(OSGCOMPAT_ENABLE_DEPRECATED_PROPS "" OFF)
142 OSG_SET_CACHE(OSG_RENDERPROPERTY_BITS 64 STRING "")
143 OSG_SET_CACHE(OSG_RENDERPROPERTY_UNIQUE_BITS 16 STRING "")
145 OSG_OPTION(OSG_GENERATE_SEPARATE_LIB_DOC "Generate separate doxygen documentation for contrib libraries" OFF)
146 OSG_OPTION(OSG_INSTALL_DOXYDOC "Install Doxygen documentation" OFF)
148 SET(OSG_DOXY_DOC_TYPE "User" CACHE STRING
149 "The type of documentation to generate (User, Developer, Trac)")
150 SET(OSG_DOXY_INPUTS CACHE FILEPATH "include given file instead of autogen")
151 SET(OSG_DOXY_STDOUT_LOG CACHE FILEPATH "log std to file")
154 #OPTION(OSG_ENABLE_MTCPTR "" ON)
155 #OPTION(OSG_ENABLE_GIF "" ON)
157 ## prep options for OSGConfigured.h
159 IF(NOT OSGCOMPAT_ENABLE_DEPRECATED)
160 SET(OSG_DISABLE_DEPRECATED 1)
161 ENDIF(NOT OSGCOMPAT_ENABLE_DEPRECATED)
163 IF(OSG_USE_OSG2_NAMESPACE)
164 ADD_DEFINITIONS(-DOSG_USE_OSG2_NAMESPACE=1)
169 ENDIF(OSG_ENABLE_SSE2)
171 IF(OSG_ENABLE_NEW_OSB_IO)
172 SET(OSG_NEW_OSB_IO 1)
173 ENDIF(OSG_ENABLE_NEW_OSB_IO)
175 IF(OSG_ENABLE_GLDEFINE_MAPPER)
176 SET(OSG_GL_DEFMAPPER 1)
177 ENDIF(OSG_ENABLE_GLDEFINE_MAPPER)
179 IF(OSG_ENABLE_OGL2_SHADERFUNCTIONS)
180 SET(OSG_OGL2_SHADERFUNCS 1)
181 ENDIF(OSG_ENABLE_OGL2_SHADERFUNCTIONS)
183 IF(OSG_ENABLE_OGL_VERTEXATTRIB_FUNCS)
184 SET(OSG_OGL_VERTEXATTRIB_FUNCS 1)
185 ENDIF(OSG_ENABLE_OGL_VERTEXATTRIB_FUNCS)
187 IF(OSG_ENABLE_NEW_GEOHANDLER)
188 SET(OSG_NEW_GEOHANDLER 1)
189 ENDIF(OSG_ENABLE_NEW_GEOHANDLER)
191 IF(OSG_ENABLE_OGL_COREONLY)
192 SET(OSG_OGL_COREONLY 1)
193 ENDIF(OSG_ENABLE_OGL_COREONLY)
195 IF(OSG_ENABLE_GL_INCLUDE_GLEW)
196 SET(OSG_GL_INCLUDE_GLEW 1)
197 ENDIF(OSG_ENABLE_GL_INCLUDE_GLEW)
199 IF(OSG_ENABLE_OGL_ES2)
201 SET(OSG_OGL_NO_DOUBLE 1)
202 ENDIF(OSG_ENABLE_OGL_ES2)
204 IF(OSG_ENABLE_OGLES_PROTOS)
205 SET(OSG_USE_OGLES_PROTOS 1)
206 SET(GL_GLEXT_PROTOTYPES 1)
207 ENDIF(OSG_ENABLE_OGLES_PROTOS)
209 IF(OSG_ENABLE_OGL3_PROTOS)
210 SET(GL_GLEXT_PROTOTYPES 1)
211 SET(GL3_PROTOTYPES 1)
212 SET(OSG_USE_OGL3_PROTOS 1)
213 ENDIF(OSG_ENABLE_OGL3_PROTOS)
215 IF(OSG_ENABLE_OGL4_PROTOS)
216 SET(GL_GLEXT_PROTOTYPES 1)
217 SET(GL3_PROTOTYPES 1)
218 SET(OSG_USE_OGL3_PROTOS 1)
219 SET(OSG_USE_OGL4_PROTOS 1)
220 ENDIF(OSG_ENABLE_OGL4_PROTOS)
222 IF(OSG_ENABLE_OGL_ES2_SIMGL3)
223 SET(OSG_OGL_ES2_SIMGL3 1)
224 ENDIF(OSG_ENABLE_OGL_ES2_SIMGL3)
226 IF(OSG_ENABLE_NEW_SHADER)
227 SET(OSG_NEW_SHADER 1)
228 ENDIF(OSG_ENABLE_NEW_SHADER)
232 ENDIF(OSGCOMPAT_ENABLE)
234 IF(NOT OSG_ENABLE_SCANPARSE_REGEN)
235 SET(OSG_PREBUILD_SCANPARSE 1)
236 ENDIF(NOT OSG_ENABLE_SCANPARSE_REGEN)
238 IF(OSG_ENABLE_ELF_LOCALSTORAGE)
239 SET(OSG_PTHREAD_ELF_TLS 1)
240 ENDIF(OSG_ENABLE_ELF_LOCALSTORAGE)
242 IF(OSG_ENABLE_WIN_LOCALSTORAGE)
243 SET(OSG_WIN32_ASPECT_USE_LOCALSTORAGE 1)
244 ENDIF(OSG_ENABLE_WIN_LOCALSTORAGE)
246 IF(OSGCOMPAT_ENABLE_DEPRECATED_PROPS)
247 SET(OSG_DEPRECATED_PROPS 1)
248 ENDIF(OSGCOMPAT_ENABLE_DEPRECATED_PROPS)
250 SET(OSG_SHC_MODE_${OSG_SHADER_CACHE_MODE} 1)
253 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
254 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
255 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
258 INCLUDE(ConfigurePackages)
260 LIST(APPEND OSG_ADDITIONAL_CONFIGURE_LINES "")
262 IF(OSGEXCLUDE_TESTS_FROM_ALL)
263 SET(OSGEXCLUDE_TESTS EXCLUDE_FROM_ALL)
265 SET(OSGEXCLUDE_TESTS "")
268 IF(OSGEXCLUDE_UNITTESTS_FROM_ALL)
269 SET(OSGEXCLUDE_UNITTESTS EXCLUDE_FROM_ALL)
271 SET(OSGEXCLUDE_UNITTESTS "")
274 IF(OSGEXCLUDE_EXAMPLES_SIMPLE_FROM_ALL)
275 SET(OSGEXCLUDE_EXAMPLES_SIMPLE EXCLUDE_FROM_ALL)
277 SET(OSGEXCLUDE_EXAMPLES_SIMPLE "")
280 IF(OSGEXCLUDE_EXAMPLES_ADVANCED_FROM_ALL)
281 SET(OSGEXCLUDE_EXAMPLES_ADVANCED EXCLUDE_FROM_ALL)
283 SET(OSGEXCLUDE_EXAMPLES_ADVANCED "")
286 #####################
287 # External extensions
288 #####################
290 OSG_SET_CACHE(OSG_EXTRA_EXTERNAL_MODULES "" STRING
291 "Extra modules that OpenSG will try to import.")
293 OSG_SET_CACHE(OSG_IGNORE_INSTALL "" STRING
294 "Extra modules that OpenSG will build but not installed.")
296 OSG_SET_CACHE(OSG_EXTERNAL_MODULES_INCLUDE "" FILEPATH
297 "Include file of extra modules")
299 IF(EXISTS "${OSG_EXTERNAL_MODULES_INCLUDE}")
300 INCLUDE("${OSG_EXTERNAL_MODULES_INCLUDE}")
303 FOREACH(EXTERNAL ${OSG_EXTRA_EXTERNAL_MODULES})
304 OPTION(OSGBUILD_${EXTERNAL}
305 "Build using ${EXTERNAL} module" OFF)
307 IF(OSGBUILD_${EXTERNAL})
308 FIND_PATH(OSG_${EXTERNAL}_SOURCE_DIR
309 CMakeLists.Lib.${EXTERNAL}.txt
310 ${CMAKE_CURRENT_SOURCE_DIR}/../${EXTERNAL})
312 OSG_ADD_OPT(OSG_${EXTERNAL}_SOURCE_DIR)
315 ${OSG_${EXTERNAL}_SOURCE_DIR}/CMakeLists.Lib.${EXTERNAL}.txt)
317 MESSAGE(SEND_ERROR "Cannot find ${EXTERNAL} sources directory: "
318 "${OSG_${EXTERNAL}_SOURCE_DIR}")
320 LIST(APPEND OSG_EXTERNAL_CONFIGS "${EXTERNAL}")
325 OSG_OPTION(OSG_LINK_EXTERNAL_MODULES_TO_CSM "" FALSE)
332 SET(OSG_PLATFORM_64 0)
333 SET(OSG_PLATFORM_32 0)
336 SET(OSG_LIBDIR_SUFFIX "")
338 IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
339 SET(OSG_PLATFORM_64 1)
340 SET(OSG_LIBDIR_SUFFIX "64")
343 SET(OSG_LIBDIR_BASE_SUFFIX "64")
350 SET(OSG_PLATFORM_32 1)
358 IF(${CMAKE_CXX_PLATFORM_ID} STREQUAL "Linux")
362 IF(NOT WIN32 AND NOT CMAKE_BUILD_TYPE)
363 SET(CMAKE_BUILD_TYPE Debug CACHE STRING
364 "Choose the type of build, options are: Debug Release."
366 ENDIF(NOT WIN32 AND NOT CMAKE_BUILD_TYPE)
369 IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND
370 NOT CMAKE_BUILD_TYPE STREQUAL "DebugGV" AND
371 NOT CMAKE_BUILD_TYPE STREQUAL "Release" AND
372 NOT CMAKE_BUILD_TYPE STREQUAL "ReleaseGV" AND
373 NOT CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" )
375 MESSAGE(FATAL_ERROR "incorrect build type ${CMAKE_BUILD_TYPE}.\n"
376 "Please use either Release or Debug")
381 IF(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
382 SET(CMAKE_BUILD_TYPE DebugOpt CACHE STRING
383 "Choose the type of build, options are: ${CMAKE_CONFIGURATION_TYPES}."
387 IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND
388 NOT CMAKE_BUILD_TYPE STREQUAL "DebugOpt" AND
389 NOT CMAKE_BUILD_TYPE STREQUAL "Release" AND
390 NOT CMAKE_BUILD_TYPE STREQUAL "ReleaseNoOpt")
392 MESSAGE(FATAL_ERROR "incorrect build type ${CMAKE_BUILD_TYPE}.\n"
393 "Please use on of ${CMAKE_CONFIGURATION_TYPES}")
398 IF(NOT OSG_COMPILER_DEFAULTS)
399 INCLUDE(CMake/SetupCompiler.cmake)
400 SET( OSG_COMPILER_DEFAULTS 1 CACHE INTERNAL "Defaults written" FORCE ) #INTERNAL
401 ENDIF(NOT OSG_COMPILER_DEFAULTS)
403 INCLUDE(CMake/UpdateCompiler.cmake)
405 IF(CMAKE_BUILD_TYPE STREQUAL "Debug" OR
406 CMAKE_BUILD_TYPE STREQUAL "DebugGV")
408 SET(OSG_LIBDIR_SUFFIX "${OSG_LIBDIR_SUFFIX}/debug")
409 SET(OSG_LIBDIR_BUILD_TYPE_SUFFIX "debug")
413 ADD_DEFINITIONS(-D OSG_BUILD_ACTIVE)
417 ##############################################################################
419 ##############################################################################
421 # Global include/library dirs, libs and definitions
422 SET(OSG_GLOBAL_DEP_INCDIR "")
423 SET(OSG_GLOBAL_DEP_LIBDIR "")
424 SET(OSG_GLOBAL_DEP_LIBS "")
425 SET(OSG_GLOBAL_DEP_DEFS "")
429 OSG_OPTION(OSG_USE_OSGSUPPORT_LIBS "" OFF)
430 OSG_OPTION(OSG_USE_STATIC_SUPPORT_LIBS "" OFF)
432 IF(OSG_USE_OSGSUPPORT_LIBS)
433 OSG_SET_CACHE(OSG_SUPPORT_ROOT "" PATH "")
434 ENDIF(OSG_USE_OSGSUPPORT_LIBS)
436 IF(EXISTS "${OSG_SUPPORT_ROOT}" AND
437 EXISTS "${OSG_SUPPORT_ROOT}/include/OSGSupportConfig.cmake")
439 INCLUDE("${OSG_SUPPORT_ROOT}/include/OSGSupportConfig.cmake")
441 SET(_OSG_FATAL_DMS_COMBO FALSE)
442 SET(_OSG_FATAL_ITER_COMBO FALSE)
444 IF( NOT OSG_DISABLE_MICROSOFT_SECURE_CXXX AND OSG_SUPPORT_DISABLE_MICROSOFT_SECURE_CXXX)
445 SET(_OSG_FATAL_DMS_COMBO TRUE)
448 IF( OSG_DISABLE_MICROSOFT_SECURE_CXXX AND NOT OSG_SUPPORT_DISABLE_MICROSOFT_SECURE_CXXX)
449 SET(_OSG_FATAL_DMS_COMBO TRUE)
452 IF(_OSG_FATAL_DMS_COMBO)
454 MESSAGE(FATAL_ERROR "Conflicting DISABLE_MS_SECURE settings:\n"
455 " Support : ${OSG_SUPPORT_DISABLE_MICROSOFT_SECURE_CXXX}\n"
456 " OpenSG : ${OSG_DISABLE_MICROSOFT_SECURE_CXXX}")
461 IF( NOT OSG_DISABLE_MS_ITERATOR_DEBUGGING AND OSG_SUPPORT_DISABLE_MS_ITERATOR_DEBUGGING)
462 SET(_OSG_FATAL_ITER_COMBO TRUE)
465 IF( OSG_DISABLE_MS_ITERATOR_DEBUGGING AND NOT OSG_SUPPORT_DISABLE_MS_ITERATOR_DEBUGGING)
466 SET(_OSG_FATAL_ITER_COMBO TRUE)
469 IF(_OSG_FATAL_ITER_COMBO)
471 MESSAGE(FATAL_ERROR "Conflicting DISABLE_MS_ITER_DEBUG settings:\n"
472 " Support : ${OSG_SUPPORT_DISABLE_MS_ITERATOR_DEBUGGING}\n"
473 " OpenSG : ${OSG_DISABLE_MS_ITERATOR_DEBUGGING}")
479 SET(OSG_INSTALL_SUBDIR "" CACHE STRING "add subdir to installed libs")
482 IF(NOT OSG_BUILD_DEPENDEND)
488 OSG_CONFIGURE_BOOST()
496 # MESSAGE(STATUS "zlib: ${ZLIB_FOUND}")
498 IF(UNIX AND NOT OSG_APPLE32)
503 FIND_PACKAGE(Freetype)
506 OSG_SET(OSG_WITH_FT2 1)
508 FIND_LIBRARY(FONTCONFIG_LIBRARY NAMES fontconfig)
510 IF(FONTCONFIG_LIBRARY MATCHES "fontconfig")
511 OSG_SET(OSG_WITH_FONTCONFIG 1)
514 ENDIF(FREETYPE_FOUND)
516 OSG_ADD_OPT(FREETYPE_FOUND)
517 OSG_ADD_OPT(FREETYPE_INCLUDE_DIR_freetype2)
518 OSG_ADD_OPT(FREETYPE_INCLUDE_DIR_ft2build)
519 OSG_ADD_OPT(FONTCONFIG_LIBRARY)
520 OSG_ADD_OPT(FREETYPE_LIBRARIES)
521 ENDIF(UNIX AND NOT OSG_APPLE32)
531 OSG_CONFIGURE_OPENEXR()
533 SET(OSG_EXTERNAL_IMAGELIBS)
534 SET(OSG_EXTERNAL_IMAGEINCS)
536 # MESSAGE(STATUS "tiff: ${TIFF_FOUND} - png ${PNG_FOUND} - jpg: ${JPEG_FOUND} - exr ${OPENEXR_FOUND}")
539 SET(OSG_EXTERNAL_IMAGELIBS ${OSG_EXTERNAL_IMAGELIBS} TIFF_LIBRARIES)
540 SET(OSG_EXTERNAL_IMAGEINCS ${OSG_EXTERNAL_IMAGEINCS} TIFF_INCLUDE_DIR)
541 OSG_SET(OSG_WITH_TIF 1)
542 OSG_ADD_OPT(TIFF_LIBRARIES)
546 SET(OSG_EXTERNAL_IMAGELIBS ${OSG_EXTERNAL_IMAGELIBS} PNG_LIBRARIES)
547 SET(OSG_EXTERNAL_IMAGEINCS ${OSG_EXTERNAL_IMAGEINCS} PNG_INCLUDE_DIR)
548 OSG_SET(OSG_WITH_PNG 1)
549 OSG_ADD_OPT(PNG_LIBRARIES)
553 SET(OSG_EXTERNAL_IMAGELIBS ${OSG_EXTERNAL_IMAGELIBS} JPEG_LIBRARIES)
554 SET(OSG_EXTERNAL_IMAGEINCS ${OSG_EXTERNAL_IMAGEINCS} JPEG_INCLUDE_DIR)
555 OSG_SET(OSG_WITH_JPG 1)
556 OSG_ADD_OPT(JPEG_LIBRARIES)
560 SET(OSG_EXTERNAL_IMAGELIBS ${OSG_EXTERNAL_IMAGELIBS} GDAL_LIBRARIES)
561 SET(OSG_EXTERNAL_IMAGEINCS ${OSG_EXTERNAL_IMAGEINCS} GDAL_INCLUDE_DIR)
562 OSG_SET(OSG_WITH_GDAL 1)
563 OSG_ADD_OPT(GDAL_LIBRARIES)
567 SET(OSG_EXTERNAL_IMAGELIBS ${OSG_EXTERNAL_IMAGELIBS} OPENEXR_LIBRARIES)
568 SET(OSG_EXTERNAL_IMAGEINCS ${OSG_EXTERNAL_IMAGEINCS} OPENEXR_INCLUDE_DIR)
569 OSG_SET(OSG_WITH_IMF 1)
571 OSG_ADD_OPT(OPENEXR_LIBRARIES)
572 OSG_ADD_OPT(OPENEXR_INCLUDE_DIR)
576 OSG_ADD_OPT(OSG_EXTERNAL_IMAGELIBS)
577 OSG_ADD_OPT(OSG_EXTERNAL_IMAGEINCS)
583 #FIND_PACKAGE(Collada)
585 OSG_CONFIGURE_COLLADA()
589 OSG_SET(OSG_WITH_COLLADA 1)
592 IF(CMAKE_BUILD_TYPE STREQUAL "Debug" OR
593 CMAKE_BUILD_TYPE STREQUAL "DebugOpt")
595 OSG_SET(OSG_COLLADA_LIBS ${COLLADA_LIBRARY_DEBUG})
599 OSG_SET(OSG_COLLADA_LIBS ${COLLADA_LIBRARY_RELEASE})
604 OSG_ADD_OPT(COLLADA_DAE_INCLUDE_DIR)
605 OSG_ADD_OPT(COLLADA_DOM_INCLUDE_DIR)
607 IF(WIN32 OR COLLADA_TARGET_FOUND)
608 SET(OSG_COLLADA_LIBS ${OSG_COLLADA_TARGETS})
609 ENDIF(WIN32 OR COLLADA_TARGET_FOUND)
613 SET(OSG_COLLADA_LIBS "")
617 OSG_ADD_OPT(COLLADA_FOUND)
626 OSG_SET(OSG_WITH_GLUT 1)
627 OSG_SET(OSG_GLUT_INC_DIR ${GLUT_INCLUDE_DIR})
628 OSG_SET(OSG_GLUT_LIBS ${GLUT_LIBRARIES})
630 OSG_SET(OSG_WITH_GLUT 0)
631 OSG_SET(OSG_GLUT_INC_DIR "")
632 OSG_SET(OSG_GLUT_LIBS "")
646 FIND_PACKAGE(OpenGLES REQUIRED)
648 OSG_ADD_OPT(OPENGL_gl_LIBRARY)
649 OSG_ADD_OPT(OPENGL_glu_LIBRARY)
651 FIND_PACKAGE(OpenGL REQUIRED)
653 OSG_ADD_OPT(OPENGL_gl_LIBRARY)
654 OSG_ADD_OPT(OPENGL_glu_LIBRARY)
657 IF(OSG_USE_OGL3_PROTOS OR OSG_USE_OGL4_PROTOS)
658 SET(OSG_OGL_INCDIRS ${CMAKE_SOURCE_DIR}/Source/External/OpenGL)
659 LIST(APPEND OSG_GLOBAL_DEP_INCDIR OSG_OGL_INCDIRS)
661 ADD_DEFINITIONS(-DOSG_USE_GL3_INCLUDES=1)
671 OSG_SET(OSG_X_LIBS ${X11_X11_LIB})
672 OSG_SET(OSG_X_INC_DIR ${X11_X11_INCLUDE_PATH})
675 OSG_ADD_OPT(X11_FOUND)
681 IF(OSG_USE_OSG_VTK_SETUP)
683 ELSE(OSG_USE_OSG_VTK_SETUP)
687 OSG_SET(OSG_WITH_VTK 1)
688 OSG_SET(OSG_VTK_LIBS vtkRendering)
690 OSG_ADD_OPT(OSG_VTK_LIBS)
691 OSG_ADD_OPT(VTK_LIBRARY_DIRS)
692 OSG_ADD_OPT(VTK_INCLUDE_DIRS)
695 ENDIF(OSG_USE_OSG_VTK_SETUP)
697 OSG_ADD_OPT(VTK_FOUND)
703 IF(WIN32 OR OSG_ENABLE_GL_INCLUDE_GLEW)
706 IF(OSG_ENABLE_GL_INCLUDE_GLEW AND GLEW_FOUND)
707 LIST(APPEND OSG_GLOBAL_DEP_INCDIR GLEW_INCLUDE_DIR)
708 ENDIF(OSG_ENABLE_GL_INCLUDE_GLEW AND GLEW_FOUND)
710 ENDIF(WIN32 OR OSG_ENABLE_GL_INCLUDE_GLEW)
716 OSG_CONFIGURE_LIBMINI()
718 OSG_ADD_OPT(OSG_LIBMINI_FOUND)
719 OSG_ADD_OPT(OSG_LIBMINI_INCLUDE_DIR)
720 OSG_ADD_OPT(OSG_LIBMINI_LIBRARIES)
726 OSG_CONFIGURE_OPENNURBS()
728 OSG_ADD_OPT(OPENNURBS_FOUND)
729 OSG_ADD_OPT(OPENNURBS_INCLUDE_DIR)
730 OSG_ADD_OPT(OPENNURBS_LIBRARIES)
736 FIND_PACKAGE(PythonInterp)
737 FIND_PACKAGE(PythonLibs)
739 OSG_ADD_OPT(PYTHON_INCLUDE_PATH)
740 OSG_ADD_OPT(PYTHON_LIBRARY)
742 IF(Boost_FOUND AND PYTHONLIBS_FOUND)
744 FIND_PACKAGE(Boost COMPONENTS python)
746 IF(Boost_FOUND AND WIN32)
748 SET(OSG_BOOST_PYTHON_TARGETS )
749 OSG_ADD_IMPORT_LIB(OSG_BOOST_PYTHON_TARGETS Boost_PYTHON_LIBRARY)
750 SET(OSG_BOOST_PYTHON_LIBS ${OSG_BOOST_PYTHON_TARGETS})
752 ELSE(Boost_FOUND AND WIN32)
754 IF(CMAKE_BUILD_TYPE STREQUAL "Debug" OR
755 CMAKE_BUILD_TYPE STREQUAL "DebugOpt")
757 SET(OSG_BOOST_PYTHON_LIBS ${Boost_PYTHON_LIBRARY_DEBUG})
760 SET(OSG_BOOST_PYTHON_LIBS ${Boost_PYTHON_LIBRARY_RELEASE})
763 ENDIF(Boost_FOUND AND WIN32)
765 # We ignore if boost python fails, we catch that somewhere else
766 # so if we get here Boost_FOUND was true in the first place
767 SET(Boost_FOUND TRUE)
771 OSG_SET_CACHE(PYOSG_PYPLUSPLUS_DIR "" PATH "")
772 OSG_SET_CACHE(PYOSG_PYPLUSPLUS_GOODIES_DIR "" PATH "")
773 OSG_SET_CACHE(PYOSG_DIR "" PATH "")
782 FIND_PROGRAM(FLEX_EXE flex)
783 FIND_PROGRAM(BISON_EXE bison)
785 OSG_ADD_OPT(FLEX_EXE)
786 OSG_ADD_OPT(BISON_EXE)
792 OSG_FIND_PACKAGE(NVidiaPerfSDK)
794 IF(NVIDIAPERFSDK_FOUND)
795 OSG_SET(OSG_WITH_NVPERFSDK 1)
796 OSG_SET(OSG_NVPERFSDK_INC_DIR ${NVIDIAPERFSDK_INCLUDE_DIR})
797 OSG_SET(OSG_NVPERFSDK_LIBS ${NVIDIAPERFSDK_LIBRARIES})
798 ELSE(NVIDIAPERFSDK_FOUND)
799 OSG_SET(OSG_WITH_NVPERFSDK 0)
800 OSG_SET(OSG_NVPERFSDK_INC_DIR "")
801 OSG_SET(OSG_NVPERFSDK_LIBS "")
802 ENDIF(NVIDIAPERFSDK_FOUND)
810 FIND_LIBRARY(OSG_THREAD_LIB NAMES pthread)
811 FIND_LIBRARY(OSG_DL_LIB NAMES dl)
813 OSG_ADD_OPT(OSG_THREAD_LIB)
814 OSG_ADD_OPT(OSG_DL_LIB)
818 FIND_LIBRARY(OSG_APPLICATIONSERVICES_FRAMEWORK NAMES ApplicationServices)
819 FIND_LIBRARY(OSG_CORESERVICES_FRAMEWORK NAMES CoreServices)
820 FIND_LIBRARY(OSG_CARBON_FRAMEWORK NAMES Carbon)
821 FIND_LIBRARY(OSG_COCOA_FRAMEWORK NAMES Cocoa)
824 OSG_ADD_OPT(CMAKE_INSTALL_PREFIX)
826 ENDIF(NOT OSG_BUILD_DEPENDEND)
828 FOREACH(EXTERNAL_CONFIG ${OSG_EXTERNAL_CONFIGS})
829 IF(EXISTS ${OSG_${EXTERNAL_CONFIG}_SOURCE_DIR}/${EXTERNAL_CONFIG}.Prepare.cmake)
830 INCLUDE(${OSG_${EXTERNAL_CONFIG}_SOURCE_DIR}/${EXTERNAL_CONFIG}.Prepare.cmake)
832 ${OSG_${EXTERNAL_CONFIG}_SOURCE_DIR}/${EXTERNAL_CONFIG}.Prepare.cmake)
833 ENDFOREACH(EXTERNAL_CONFIG ${OSG_EXTERNAL_CONFIGS})
835 IF(OSG_GLOBAL_PREP AND EXISTS ${OSG_GLOBAL_PREP})
836 INCLUDE(${OSG_GLOBAL_PREP})
837 ENDIF(OSG_GLOBAL_PREP AND EXISTS ${OSG_GLOBAL_PREP})
839 IF(APPLE AND OSG_COCOA_FRAMEWORK)
840 OSG_SET(OSG_NATIVE_WINDOW OSGWindowCocoa)
842 OSG_SET(OSG_NATIVE_WINDOW OSGWindowWIN32)
843 ELSEIF(UNIX AND X11_FOUND)
844 OSG_SET(OSG_NATIVE_WINDOW OSGWindowX)
845 ELSEIF(APPLE AND IOS)
846 OSG_SET(OSG_NATIVE_WINDOW OSGWindowEAGL)
848 OSG_SET(OSG_NATIVE_WINDOW "")
855 IF(EXISTS "${OSG_SUPPORT_ROOT}/bin/doxygen" AND NOT DOXYGEN_EXECUTABLE)
856 SET(DOXYGEN_EXECUTABLE "${OSG_SUPPORT_ROOT}/bin/doxygen"
857 CACHE FILEPATH "doxygen executable (custom)" FORCE)
860 FIND_PACKAGE(Doxygen)
862 ##############################################################################
863 # Overrides if dependend
864 ##############################################################################
867 IF(OSG_BUILD_DEPENDEND)
868 MESSAGE(STATUS "Load reference settings")
869 INCLUDE(${OSG_REFERENCE_DIR}/CMake.settings)
870 # Needed to get the correct vtk/boost settings
872 OSG_BOOST_DEP_SETUP()
874 ELSE(OSG_BUILD_DEPENDEND)
875 # OSG_WRITE_SETTINGS(${CMAKE_BINARY_DIR}/CMake.settings)
876 ENDIF(OSG_BUILD_DEPENDEND)
879 ##############################################################################
881 ##############################################################################
883 # when adding passes, make sure to add a corresponding pass directory variable
884 # OSG_PASSDIR_${PASSNAME} - this variable may not be empty!
885 SET(OSG_CMAKE_PASSES "OSGCOLLECT" "OSGSETUP")
887 SET(OSG_PASSDIR_OSGCOLLECT "Collect")
888 SET(OSG_PASSDIR_OSGSETUP "Build")
890 ADD_CUSTOM_TARGET(OSGAll)
896 FILE(GLOB OSG_OLD_BUILD_FILES "${CMAKE_BINARY_DIR}/*.cmake")
898 IF(OSG_OLD_BUILD_FILES)
899 FILE(REMOVE ${OSG_OLD_BUILD_FILES})
900 ENDIF(OSG_OLD_BUILD_FILES)
902 FILE(GLOB OSG_OLD_CONFIG_FILES "${CMAKE_BINARY_DIR}/bin/osg2-config.part*.tmp")
904 IF(OSG_OLD_CONFIG_FILES)
905 FILE(REMOVE ${OSG_OLD_CONFIG_FILES})
906 ENDIF(OSG_OLD_CONFIG_FILES)
912 ADD_CUSTOM_TARGET(OSGAllApps)
913 ADD_DEPENDENCIES(OSGAll OSGAllApps)
915 # optional pass for test programs
917 LIST(APPEND OSG_CMAKE_PASSES "OSGSETUPTEST")
918 SET(OSG_PASSDIR_OSGSETUPTEST "Test")
920 ADD_CUSTOM_TARGET(OSGAllTests)
921 ADD_DEPENDENCIES(OSGAll OSGAllTests)
922 ENDIF(OSGBUILD_TESTS)
928 IF(OSGBUILD_UNITTESTS)
932 # optional pass for unittest programs
933 LIST(APPEND OSG_CMAKE_PASSES "OSGSETUPUNITTEST")
934 SET(OSG_PASSDIR_OSGSETUPUNITTEST "UnitTest")
936 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/Tools/unittest-cpp"
937 "${OSG_PASSDIR_OSGSETUPUNITTEST}")
939 SET(OSG_UNITTEST_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/Tools/unittest-cpp/UnitTest++/src")
940 SET(OSG_UNITTEST_LIBRARY_DIRS "${CMAKE_BINARY_DIR}/bin")
941 SET(OSG_UNITTEST_LIBRARY "UnitTest++")
943 ADD_CUSTOM_TARGET(OSGAllUnitTests)
944 ADD_DEPENDENCIES(OSGAll OSGAllUnitTests)
945 ENDIF(OSGBUILD_UNITTESTS)
951 # optional pass for test programs
952 IF(OSGBUILD_PYTHON_BINDINGS)
953 LIST(APPEND OSG_CMAKE_PASSES "OSGPYTHON")
954 SET(OSG_PASSDIR_OSGPYTHON "Python")
956 IF(EXISTS ${PYOSG_PYPLUSPLUS_DIR})
957 SET(OSG_HAS_PYOSG_PYPLUSPLUS_DIR "True")
959 SET(OSG_HAS_PYOSG_PYPLUSPLUS_DIR "False")
962 IF(EXISTS ${PYOSG_PYPLUSPLUS_GOODIES_DIR})
963 SET(OSG_HAS_PYOSG_PYPLUSPLUS_GOODIES_DIR "True")
965 SET(OSG_HAS_PYOSG_PYPLUSPLUS_GOODIES_DIR "False")
968 SET(OSG_CAN_REGEN_PYTHON_BINDINGS FALSE)
972 PYOSG_PYPLUSPLUS_DIR AND
973 PYOSG_PYPLUSPLUS_GOODIES_DIR)
975 IF(EXISTS ${GCCXML} AND
976 EXISTS ${PYOSG_DIR} AND
977 EXISTS ${PYOSG_PYPLUSPLUS_DIR} AND
978 EXISTS ${PYOSG_PYPLUSPLUS_GOODIES_DIR})
980 SET(OSG_CAN_REGEN_PYTHON_BINDINGS TRUE)
986 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
987 "${CMAKE_SOURCE_DIR}/Bindings/Python/genLibOrder.py"
988 "${CMAKE_BINARY_DIR}/Python/Helper/genLibOrder.py")
990 FILE(WRITE "${CMAKE_BINARY_DIR}/Python/Helper/libOrder.py" "# Lib order information\n\n\nlibInfo = {}\n\n")
991 FILE(APPEND "${CMAKE_BINARY_DIR}/Python/Helper/libOrder.py" "fullLibInfo = {}\n\n")
993 IF(EXISTS ${PYOSG_DIR})
994 FILE(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/Python/Helper")
996 #########################
998 #########################
1000 SET(_OSG_FILE_IN "${PYOSG_DIR}/src/osggen.py")
1001 SET(_OSG_FILE_OUT_PROC "${CMAKE_BINARY_DIR}/Python/Helper/processed/osggen.py.proc")
1002 SET(_OSG_FILE_OUT "${CMAKE_BINARY_DIR}/Python/Helper/osggen.py")
1003 SET(_OSG_PATCH_FILE "${CMAKE_SOURCE_DIR}/Bindings/Python/Patches/osggen.py.patch")
1006 COMMAND "${CMAKE_COMMAND}" -E copy
1008 "${_OSG_FILE_OUT_PROC}")
1010 EXECUTE_PROCESS(COMMAND "patch"
1011 INPUT_FILE "${_OSG_PATCH_FILE}"
1012 WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/Python/Helper/processed")
1015 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1016 "${_OSG_FILE_OUT_PROC}"
1020 #########################
1022 #########################
1025 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1026 "${CMAKE_SOURCE_DIR}/Bindings/Python/splitGenHelper.py"
1027 "${CMAKE_BINARY_DIR}/Python/Helper/splitGenHelper.py")
1029 #########################
1031 #########################
1033 SET(_OSG_FILE_IN "${PYOSG_DIR}/src/settings.py")
1034 SET(_OSG_FILE_OUT_PROC "${CMAKE_BINARY_DIR}/Python/Helper/processed/settings.py.proc")
1035 SET(_OSG_FILE_OUT "${CMAKE_BINARY_DIR}/Python/Helper/settings.py")
1036 SET(_OSG_PATCH_FILE "${CMAKE_SOURCE_DIR}/Bindings/Python/Patches/settings.py.patch")
1039 COMMAND "${CMAKE_COMMAND}" -E copy
1041 "${_OSG_FILE_OUT_PROC}")
1043 EXECUTE_PROCESS(COMMAND "patch"
1044 INPUT_FILE "${_OSG_PATCH_FILE}"
1045 WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/Python/Helper/processed")
1048 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1049 "${_OSG_FILE_OUT_PROC}"
1052 #########################
1054 #########################
1056 SET(_OSG_FILE_IN "${PYOSG_DIR}/src/osg_module/PreBoostPython.h")
1057 SET(_OSG_FILE_OUT_PROC "${CMAKE_SOURCE_DIR}/Bindings/Python/Common/processed/PreBoostPython.h.proc")
1058 SET(_OSG_FILE_OUT "${CMAKE_SOURCE_DIR}/Bindings/Python/Common/PreBoostPython.h")
1060 FILE(READ ${_OSG_FILE_IN} _OSG_FILE_IN_DATA)
1062 STRING(REPLACE "<OpenSG/"
1063 "<" _OSG_FILE_IN_DATA_P1 "${_OSG_FILE_IN_DATA}")
1065 FILE(WRITE ${_OSG_FILE_OUT_PROC} "${_OSG_FILE_IN_DATA_P1}")
1068 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1069 "${_OSG_FILE_OUT_PROC}"
1073 #########################
1075 #########################
1077 SET(_OSG_FILE_IN "${PYOSG_DIR}/src/osg_module/OsgPtrHelpers.h")
1078 SET(_OSG_FILE_OUT_PROC "${CMAKE_SOURCE_DIR}/Bindings/Python/Common/processed/OsgPtrHelpers.h.proc")
1079 SET(_OSG_FILE_OUT "${CMAKE_SOURCE_DIR}/Bindings/Python/Common/OsgPtrHelpers.h")
1081 FILE(READ ${_OSG_FILE_IN} _OSG_FILE_IN_DATA)
1083 STRING(REPLACE "<OpenSG/"
1084 "<" _OSG_FILE_IN_DATA_P1 "${_OSG_FILE_IN_DATA}")
1086 FILE(WRITE ${_OSG_FILE_OUT_PROC} "${_OSG_FILE_IN_DATA_P1}")
1089 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1090 "${_OSG_FILE_OUT_PROC}"
1094 #########################
1095 # pypp_OSGBase_aliases.h
1096 #########################
1098 SET(_OSG_FILE_IN "${PYOSG_DIR}/src/osg_module/aliases.h")
1099 SET(_OSG_FILE_OUT_PROC "${CMAKE_SOURCE_DIR}/Bindings/Python/Common/processed/pypp_aliases.h.proc")
1100 SET(_OSG_FILE_OUT "${CMAKE_SOURCE_DIR}/Bindings/Python/Common/pypp_aliases.h")
1101 SET(_OSG_PATCH_FILE "${CMAKE_SOURCE_DIR}/Bindings/Python/Patches/pypp_aliases.h.patch")
1104 COMMAND "${CMAKE_COMMAND}" -E copy
1106 "${_OSG_FILE_OUT_PROC}")
1108 EXECUTE_PROCESS(COMMAND "patch"
1109 INPUT_FILE "${_OSG_PATCH_FILE}"
1110 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/Bindings/Python/Common/processed")
1113 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1114 "${_OSG_FILE_OUT_PROC}"
1118 #########################
1120 #########################
1122 SET(_OSG_FILE_IN "${PYOSG_DIR}/src/osg_module/ColorWrapper.h")
1123 SET(_OSG_FILE_OUT_PROC "${CMAKE_SOURCE_DIR}/Source/Base/Bindings/Python/Wrapper/processed/ColorWrapper.h.proc")
1124 SET(_OSG_FILE_OUT "${CMAKE_SOURCE_DIR}/Source/Base/Bindings/Python/Wrapper/ColorWrapper.h")
1126 FILE(READ ${_OSG_FILE_IN} _OSG_FILE_IN_DATA)
1128 STRING(REPLACE "<OpenSG/"
1129 "<" _OSG_FILE_IN_DATA_P1 "${_OSG_FILE_IN_DATA}")
1131 FILE(WRITE ${_OSG_FILE_OUT_PROC} "${_OSG_FILE_IN_DATA_P1}")
1134 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1135 "${_OSG_FILE_OUT_PROC}"
1139 #########################
1140 # VecStorageWrappers.h
1141 #########################
1143 SET(_OSG_FILE_IN "${PYOSG_DIR}/src/osg_module/VecStorageWrappers.h")
1144 SET(_OSG_FILE_OUT_PROC "${CMAKE_SOURCE_DIR}/Source/Base/Bindings/Python/Wrapper/processed/VecStorageWrappers.h.proc")
1145 SET(_OSG_FILE_OUT "${CMAKE_SOURCE_DIR}/Source/Base/Bindings/Python/Wrapper/VecStorageWrappers.h")
1147 FILE(READ ${_OSG_FILE_IN} _OSG_FILE_IN_DATA)
1149 STRING(REPLACE "<OpenSG/"
1150 "<" _OSG_FILE_IN_DATA_P1 "${_OSG_FILE_IN_DATA}")
1152 FILE(WRITE ${_OSG_FILE_OUT_PROC} "${_OSG_FILE_IN_DATA_P1}")
1155 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1156 "${_OSG_FILE_OUT_PROC}"
1160 #########################
1162 #########################
1164 SET(_OSG_FILE_IN "${PYOSG_DIR}/src/osg_module/Wrappers.h")
1165 SET(_OSG_FILE_OUT_PROC "${CMAKE_SOURCE_DIR}/Source/Base/Bindings/Python/Wrapper/processed/BaseWrappers.h.proc")
1166 SET(_OSG_FILE_OUT "${CMAKE_SOURCE_DIR}/Source/Base/Bindings/Python/Wrapper/BaseWrappers.h")
1167 SET(_OSG_PATCH_FILE "${CMAKE_SOURCE_DIR}/Source/Base/Bindings/Python/Patches/wrappers.h.patch")
1170 COMMAND "${CMAKE_COMMAND}" -E copy
1172 "${_OSG_FILE_OUT_PROC}")
1174 EXECUTE_PROCESS(COMMAND "patch"
1175 INPUT_FILE "${_OSG_PATCH_FILE}"
1176 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/Source/Base/Bindings/Python/Wrapper/processed")
1179 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1180 "${_OSG_FILE_OUT_PROC}"
1184 #########################
1186 #########################
1188 SET(_OSG_FILE_IN "${PYOSG_DIR}/src/osg_module/Wrappers.cpp")
1189 SET(_OSG_FILE_OUT_PROC "${CMAKE_SOURCE_DIR}/Source/Base/Bindings/Python/Wrapper/processed/BaseWrappers.cpp.proc")
1190 SET(_OSG_FILE_OUT "${CMAKE_SOURCE_DIR}/Source/Base/Bindings/Python/Wrapper/BaseWrappers.cpp")
1191 SET(_OSG_PATCH_FILE "${CMAKE_SOURCE_DIR}/Source/Base/Bindings/Python/Patches/wrappers.cpp.patch")
1194 COMMAND "${CMAKE_COMMAND}" -E copy
1196 "${_OSG_FILE_OUT_PROC}")
1198 EXECUTE_PROCESS(COMMAND "patch"
1199 INPUT_FILE "${_OSG_PATCH_FILE}"
1200 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/Source/Base/Bindings/Python/Wrapper/processed")
1203 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1204 "${_OSG_FILE_OUT_PROC}"
1209 #########################
1211 #########################
1213 SET(_OSG_FILE_IN "${PYOSG_DIR}/src/osg_module/Wrappers.h")
1214 SET(_OSG_FILE_OUT_PROC "${CMAKE_SOURCE_DIR}/Source/System/Bindings/Python/Wrapper/processed/SystemWrappers.h.proc")
1215 SET(_OSG_FILE_OUT "${CMAKE_SOURCE_DIR}/Source/System/Bindings/Python/Wrapper/SystemWrappers.h")
1216 SET(_OSG_PATCH_FILE "${CMAKE_SOURCE_DIR}/Source/System/Bindings/Python/Patches/wrappers.h.patch")
1219 COMMAND "${CMAKE_COMMAND}" -E copy
1221 "${_OSG_FILE_OUT_PROC}")
1223 EXECUTE_PROCESS(COMMAND "patch"
1224 INPUT_FILE "${_OSG_PATCH_FILE}"
1225 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/Source/System/Bindings/Python/Wrapper/processed")
1228 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1229 "${_OSG_FILE_OUT_PROC}"
1233 #########################
1234 # SystemWrappers.cpp
1235 #########################
1237 SET(_OSG_FILE_IN "${PYOSG_DIR}/src/osg_module/Wrappers.cpp")
1238 SET(_OSG_FILE_OUT_PROC "${CMAKE_SOURCE_DIR}/Source/System/Bindings/Python/Wrapper/processed/SystemWrappers.cpp.proc")
1239 SET(_OSG_FILE_OUT "${CMAKE_SOURCE_DIR}/Source/System/Bindings/Python/Wrapper/SystemWrappers.cpp")
1240 SET(_OSG_PATCH_FILE "${CMAKE_SOURCE_DIR}/Source/System/Bindings/Python/Patches/wrappers.cpp.patch")
1243 COMMAND "${CMAKE_COMMAND}" -E copy
1245 "${_OSG_FILE_OUT_PROC}")
1247 EXECUTE_PROCESS(COMMAND "patch"
1248 INPUT_FILE "${_OSG_PATCH_FILE}"
1249 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/Source/System/Bindings/Python/Wrapper/processed")
1252 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1253 "${_OSG_FILE_OUT_PROC}"
1257 #########################
1259 #########################
1261 SET(_OSG_FILE_IN "${PYOSG_DIR}/src/osg_module/lib/helpers.py")
1262 SET(_OSG_FILE_OUT_PROC "${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/processed/helpers.py.proc")
1263 SET(_OSG_FILE_OUT "${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/helpers.py")
1264 SET(_OSG_PATCH_FILE "${CMAKE_SOURCE_DIR}/Bindings/Python/Patches/helpers.py.patch")
1267 COMMAND "${CMAKE_COMMAND}" -E copy
1269 "${_OSG_FILE_OUT_PROC}")
1271 EXECUTE_PROCESS(COMMAND "patch"
1272 INPUT_FILE "${_OSG_PATCH_FILE}"
1273 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/processed")
1276 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1277 "${_OSG_FILE_OUT_PROC}"
1281 #########################
1283 #########################
1285 SET(_OSG_FILE_IN "${PYOSG_DIR}/src/osg_module/lib/cored_node.py")
1286 SET(_OSG_FILE_OUT_PROC "${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/processed/cored_node.py.proc")
1287 SET(_OSG_FILE_OUT "${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/cored_node.py")
1288 SET(_OSG_PATCH_FILE "${CMAKE_SOURCE_DIR}/Bindings/Python/Patches/cored_node.py.patch")
1291 COMMAND "${CMAKE_COMMAND}" -E copy
1293 "${_OSG_FILE_OUT_PROC}")
1295 EXECUTE_PROCESS(COMMAND "patch"
1296 INPUT_FILE "${_OSG_PATCH_FILE}"
1297 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/processed")
1300 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1301 "${_OSG_FILE_OUT_PROC}"
1305 #########################
1307 #########################
1309 SET(_OSG_FILE_IN "${PYOSG_DIR}/src/osg_module/lib/fcd_reflector.py")
1310 SET(_OSG_FILE_OUT_PROC "${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/processed/fcd_reflector.py.proc")
1311 SET(_OSG_FILE_OUT "${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/fcd_reflector.py")
1312 SET(_OSG_PATCH_FILE "${CMAKE_SOURCE_DIR}/Bindings/Python/Patches/fcd_reflector.py.patch")
1315 COMMAND "${CMAKE_COMMAND}" -E copy
1317 "${_OSG_FILE_OUT_PROC}")
1319 EXECUTE_PROCESS(COMMAND "patch"
1320 INPUT_FILE "${_OSG_PATCH_FILE}"
1321 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/processed")
1324 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1325 "${_OSG_FILE_OUT_PROC}"
1328 ENDIF(EXISTS ${PYOSG_DIR})
1330 SET(_OSG_SRC_PYPATH_HELPERS ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers)
1331 SET(_OSG_SRC_PYPATH_OSG ${CMAKE_BINARY_DIR}/Python/lib/osg2/helpers)
1333 SET(_OSG_DST_PYPATH_HELPERS ${CMAKE_BINARY_DIR}/Python/lib/osg2/helpers)
1334 SET(_OSG_DST_PYPATH_OSG ${CMAKE_BINARY_DIR}/Python/lib/osg2/osg)
1336 FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Python/lib/osg2)
1337 FILE(MAKE_DIRECTORY ${_OSG_DST_PYPATH_HELPERS})
1338 FILE(MAKE_DIRECTORY ${_OSG_DST_PYPATH_OSG})
1340 OSG_SYMLINK_CHECKED(${CMAKE_SOURCE_DIR}/Bindings/Python/osg2/__init__.py
1341 ${CMAKE_BINARY_DIR}/Python/lib/osg2/__init__.py)
1343 OSG_SYMLINK_CHECKED(${_OSG_SRC_PYPATH_HELPERS}/cored_node.py
1344 ${_OSG_DST_PYPATH_HELPERS}/cored_node.py)
1345 OSG_SYMLINK_CHECKED(${_OSG_SRC_PYPATH_HELPERS}/fcd_reflector.py
1346 ${_OSG_DST_PYPATH_HELPERS}/fcd_reflector.py)
1347 OSG_SYMLINK_CHECKED(${_OSG_SRC_PYPATH_HELPERS}/helpers.py
1348 ${_OSG_DST_PYPATH_HELPERS}/helpers.py)
1349 OSG_SYMLINK_CHECKED(${_OSG_SRC_PYPATH_HELPERS}/__init__.py
1350 ${_OSG_DST_PYPATH_HELPERS}/__init__.py)
1352 ADD_CUSTOM_TARGET(OSGPy)
1353 IF(OSG_CAN_REGEN_PYTHON_BINDINGS)
1354 ADD_CUSTOM_TARGET(OSGPyGen)
1356 # ADD_CUSTOM_TARGET(OSGPyBuild)
1358 ENDIF(OSGBUILD_PYTHON_BINDINGS)
1363 SET(OSG_DOXY_HTML_DIR "${CMAKE_BINARY_DIR}/Doc/html")
1364 FILE(MAKE_DIRECTORY ${OSG_DOXY_HTML_DIR})
1366 IF(OSG_GENERATE_SEPARATE_LIB_DOC)
1367 ADD_CUSTOM_TARGET(Doc)
1370 IF(DOXYGEN_EXECUTABLE)
1371 SET(DOXYGEN_VERSION)
1372 EXECUTE_PROCESS(COMMAND "${DOXYGEN_EXECUTABLE}" "--version"
1373 OUTPUT_VARIABLE DOXYGEN_VERSION
1374 OUTPUT_STRIP_TRAILING_WHITESPACE)
1375 IF(DOXYGEN_VERSION STREQUAL "1.7.3")
1376 MESSAGE(WARNING "Detected doxygen version 1.7.3, which is known to crash "
1377 "when building OpenSG documentation. "
1378 "Please use a different version, sorry for the inconvenience.")
1379 ENDIF(DOXYGEN_VERSION STREQUAL "1.7.3")
1380 ENDIF(DOXYGEN_EXECUTABLE)
1382 IF(NOT OSG_DOXY_INPUTS)
1383 # add a pass for doxygen to run
1384 LIST(APPEND OSG_CMAKE_PASSES "OSGDOXYDOC")
1385 SET(OSG_PASSDIR_OSGDOXYDOC "Doc")
1386 ENDIF(NOT OSG_DOXY_INPUTS)
1388 # set up variables for the config file
1389 IF(DOXYGEN_DOT_EXECUTABLE)
1390 SET(OSG_DOXY_HAVE_DOT "YES")
1391 ENDIF(DOXYGEN_DOT_EXECUTABLE)
1393 SET(OSG_DOXY_CONFIGURATION_FILE_IN "${CMAKE_SOURCE_DIR}/Doc/opensg-doxy.in")
1394 SET(OSG_DOXY_CONFIGURATION_FILE "${CMAKE_BINARY_DIR}/Doc/opensg-doxy")
1396 SET(OSG_DOXY_HTML_CSS "${CMAKE_SOURCE_DIR}/Doc/doxygen_osg.css")
1398 IF(OSG_DOXY_DOC_TYPE STREQUAL "User")
1399 SET(OSG_DOXY_FULL_PATH_NAMES "YES")
1400 SET(OSG_DOXY_STRIP_FROM_PATH "${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}")
1401 SET(OSG_DOXY_INTERNAL_DOCS "NO")
1402 SET(OSG_DOXY_STRIP_CODE_COMMENTS "YES")
1403 SET(OSG_DOXY_GENERATE_TREEVIEW "NO")
1404 SET(OSG_DOXY_SEARCHENGINE "NO")
1406 ELSEIF(OSG_DOXY_DOC_TYPE STREQUAL "Developer")
1407 SET(OSG_DOXY_FULL_PATH_NAMES "YES")
1408 SET(OSG_DOXY_STRIP_FROM_PATH "${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}")
1409 SET(OSG_DOXY_INTERNAL_DOCS "YES")
1410 SET(OSG_DOXY_STRIP_CODE_COMMENTS "NO")
1411 SET(OSG_DOXY_GENERATE_TREEVIEW "YES")
1412 SET(OSG_DOXY_SEARCHENGINE "NO")
1414 ELSEIF(OSG_DOXY_DOC_TYPE STREQUAL "Trac")
1415 SET(OSG_DOXY_FULL_PATH_NAMES "NO")
1416 SET(OSG_DOXY_INTERNAL_DOCS "NO")
1417 SET(OSG_DOXY_STRIP_CODE_COMMENTS "YES")
1418 SET(OSG_DOXY_HAVE_DOT "NO")
1419 SET(OSG_DOXY_GENERATE_TREEVIEW "NO")
1420 SET(OSG_DOXY_HTML_HEADER "${CMAKE_SOURCE_DIR}/Doc/TracHeader.html")
1421 SET(OSG_DOXY_HTML_FOOTER "${CMAKE_SOURCE_DIR}/Doc/TracFooter.html")
1422 SET(OSG_DOXY_SEARCHENGINE "NO")
1424 ENDIF(OSG_DOXY_DOC_TYPE STREQUAL "User")
1426 IF(NOT OSG_GENERATE_SEPARATE_LIB_DOC)
1427 SET(OSG_OpenSG_DOC_DIRECTORY "${CMAKE_BINARY_DIR}/Doc/html/Full")
1429 SET(OSG_OpenSG_DOC_DIRECTORY "${CMAKE_BINARY_DIR}/Doc/html/Glue")
1432 FILE(MAKE_DIRECTORY ${OSG_OpenSG_DOC_DIRECTORY})
1434 SET(OSG_DOC_BASIC_INPUT "${CMAKE_BINARY_DIR}/Doc/Include/OSGFullDoc.include")
1435 SET(OSG_DOC_GENERAL_INPUT "${CMAKE_BINARY_DIR}/Doc/Include/OSGGeneralDoc.include")
1437 IF(NOT OSG_GENERATE_SEPARATE_LIB_DOC)
1438 SET(OSG_DOC_SECTION "all_in_one")
1440 SET(OSG_DOC_SECTION "separate")
1443 # write doxygen config file
1444 CONFIGURE_FILE("${OSG_DOXY_CONFIGURATION_FILE_IN}"
1445 "${OSG_DOXY_CONFIGURATION_FILE}")
1447 SET(OSG_DOC_BASIC_INPUT "${CMAKE_BINARY_DIR}/Doc/Include/OSGDummy.include")
1449 # find/process documentation include files
1450 FILE(GLOB OSG_DOC_INCLUDES "${CMAKE_SOURCE_DIR}/Doc/Include/*.include")
1452 FOREACH(_OSG_DOC_INCLUDE_FULL ${OSG_DOC_INCLUDES})
1454 GET_FILENAME_COMPONENT(_OSG_DOC_INCLUDE ${_OSG_DOC_INCLUDE_FULL} NAME)
1456 CONFIGURE_FILE("${_OSG_DOC_INCLUDE_FULL}"
1457 "${CMAKE_BINARY_DIR}/Doc/Include/${_OSG_DOC_INCLUDE}")
1462 FILE(APPEND ${OSG_DOXY_CONFIGURATION_FILE}
1463 "@INCLUDE = ${OSG_DOXY_INPUTS}\n")
1464 ENDIF(OSG_DOXY_INPUTS)
1467 IF(DOXYGEN_EXECUTABLE)
1468 ADD_CUSTOM_TARGET(DocUpload COMMAND unison -batch -ui text opensg_doc)
1469 ADD_DEPENDENCIES(DocUpload Doc)
1472 ADD_CUSTOM_TARGET(DocSyncGV
1473 COMMAND rsync html -av --delete html rsync://tombstone.camtech.ntu.edu.sg/opensgdoc
1474 WORKING_DIRECTORY Doc)
1476 ADD_CUSTOM_TARGET(DocCompleteGV)
1477 ADD_DEPENDENCIES(DocCompleteGV Doc DocSyncGV)
1478 ENDIF(DOXYGEN_EXECUTABLE)
1480 ADD_CUSTOM_TARGET(OSGAllLibs)
1481 ADD_DEPENDENCIES(OSGAll OSGAllLibs)
1483 ADD_CUSTOM_TARGET(OSGAllCoreLibs)
1484 ADD_CUSTOM_TARGET(OSGAllContribLibs)
1490 FOREACH(_OSGCORE_EXT_DIR ${OSG_CORE_EXTENSIONS})
1491 MESSAGE(STATUS "processing core ext : ${_OSGCORE_EXT_DIR}")
1493 FILE(GLOB_RECURSE _OSG_LIBRARY_EXT_CONFIG_FILES
1494 "${_OSGCORE_EXT_DIR}/*CMakeLists.Extension.*.txt")
1496 FOREACH(_OSGCORE_EXT_FILE ${_OSG_LIBRARY_EXT_CONFIG_FILES})
1497 MESSAGE(STATUS " Found and process ${_OSGCORE_EXT_FILE}")
1498 INCLUDE(${_OSGCORE_EXT_FILE})
1499 ENDFOREACH(_OSGCORE_EXT_FILE ${OSG_LIBRARY_EXT_CONFIG_FILES})
1502 ENDFOREACH(_OSGCORE_EXT_DIR ${OSG_CORE_EXTENSIONS})
1504 # Find files describing libraries to build, but make sure base
1505 # and system are processed first
1506 FILE(GLOB_RECURSE OSG_LIBRARY_CONFIG_FILE_BASE RELATIVE "${CMAKE_SOURCE_DIR}"
1507 "Source/CMakeLists.Lib.OSGBase.txt")
1509 FILE(GLOB_RECURSE OSG_LIBRARY_CONFIG_FILE_SYSTEM RELATIVE "${CMAKE_SOURCE_DIR}"
1510 "Source/CMakeLists.Lib.OSGSystem.txt")
1512 FILE(GLOB_RECURSE _OSG_LIBRARY_CONFIG_FILES RELATIVE "${CMAKE_SOURCE_DIR}"
1513 "Source/*CMakeLists.Lib.*.txt")
1515 LIST(REMOVE_ITEM _OSG_LIBRARY_CONFIG_FILES ${OSG_LIBRARY_CONFIG_FILE_BASE})
1516 LIST(REMOVE_ITEM _OSG_LIBRARY_CONFIG_FILES ${OSG_LIBRARY_CONFIG_FILE_SYSTEM})
1518 LIST(APPEND OSG_LIBRARY_CONFIG_FILES ${OSG_LIBRARY_CONFIG_FILE_BASE})
1519 LIST(APPEND OSG_LIBRARY_CONFIG_FILES ${OSG_LIBRARY_CONFIG_FILE_SYSTEM})
1521 FOREACH(_OSG_LIBRARY_CONFIG ${_OSG_LIBRARY_CONFIG_FILES})
1522 STRING(REGEX MATCH Source/Contrib _OSG_FOUND_CONTRIB_CONFIG ${_OSG_LIBRARY_CONFIG})
1524 IF(_OSG_FOUND_CONTRIB_CONFIG)
1525 LIST(APPEND _OSG_CONTRIB_LIBRARY_CONFIG_FILES ${_OSG_LIBRARY_CONFIG})
1527 LIST(APPEND OSG_LIBRARY_CONFIG_FILES ${_OSG_LIBRARY_CONFIG})
1528 ENDIF(_OSG_FOUND_CONTRIB_CONFIG)
1529 ENDFOREACH(_OSG_LIBRARY_CONFIG ${_OSG_LIBRARY_CONFIG_FILES})
1531 LIST(APPEND OSG_LIBRARY_CONFIG_FILES ${_OSG_CONTRIB_LIBRARY_CONFIG_FILES})
1533 FOREACH(_OSG_LIBRARY_CONFIG ${OSG_LIBRARY_CONFIG_FILES})
1535 GET_FILENAME_COMPONENT(_OSG_LIBCONFIG_DIR
1536 ${_OSG_LIBRARY_CONFIG}
1539 GET_FILENAME_COMPONENT(_OSG_LIBCONFIG_BASENAME
1540 ${_OSG_LIBRARY_CONFIG}
1543 STRING(REPLACE CMakeLists.Lib. "" _OSG_LIBCONFIG_BASENAME_1
1544 ${_OSG_LIBCONFIG_BASENAME})
1546 GET_FILENAME_COMPONENT(_OSG_LIBCONFIG_BASENAME
1547 ${_OSG_LIBCONFIG_BASENAME_1}
1550 IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_OSG_LIBCONFIG_DIR}/${_OSG_LIBCONFIG_BASENAME}.Prepare.cmake")
1551 INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/${_OSG_LIBCONFIG_DIR}/${_OSG_LIBCONFIG_BASENAME}.Prepare.cmake")
1558 SET(OSG_WITH_CUDA 1)
1560 ELSE(OSG_ENABLE_CUDA)
1561 SET(OSG_WITH_CUDA 0)
1562 ENDIF(OSG_ENABLE_CUDA)
1564 SET(OSG_WITH_OPENCL)
1568 IF(NOT OSG_BUILD_DEPENDEND)
1569 OSG_WRITE_SETTINGS(${CMAKE_BINARY_DIR}/CMake.settings)
1570 ENDIF(NOT OSG_BUILD_DEPENDEND)
1574 FOREACH(PASS ${OSG_CMAKE_PASSES})
1575 SET(OSG_CMAKE_PASS ${PASS})
1577 MESSAGE(STATUS "\nPASS : ${OSG_CMAKE_PASS} in ${OSG_PASSDIR_${PASS}}\n")
1579 FOREACH(LIBCONFIGFILE ${OSG_LIBRARY_CONFIG_FILES})
1580 GET_FILENAME_COMPONENT(LIBCONFIGDIR "${LIBCONFIGFILE}" PATH)
1581 GET_FILENAME_COMPONENT(LIBFILENAME "${LIBCONFIGFILE}" NAME)
1582 STRING(REPLACE "CMakeLists.Lib." "" LIBFILENAME "${LIBFILENAME}")
1583 STRING(REPLACE ".txt" "" LIBFILENAME "${LIBFILENAME}")
1585 STRING(REGEX MATCH OSGContrib*|OSGTest* _OSG_IS_CONTRIBLIB ${LIBFILENAME})
1587 IF(_OSG_IS_CONTRIBLIB)
1588 SET(OSG_MAIN_LIB_TARGET OSGAllContribLibs)
1590 SET(OSG_MAIN_LIB_TARGET OSGAllCoreLibs)
1593 ADD_SUBDIRECTORY("${LIBCONFIGDIR}" "${OSG_PASSDIR_${PASS}}/${LIBFILENAME}")
1594 ENDFOREACH(LIBCONFIGFILE)
1596 SET(OSG_MAIN_LIB_TARGET OSGAllContribLibs)
1598 FOREACH(EXTERNAL_CONFIG ${OSG_EXTERNAL_CONFIGS})
1599 ADD_SUBDIRECTORY("${OSG_${EXTERNAL_CONFIG}_SOURCE_DIR}"
1600 "External/${EXTERNAL_CONFIG}/${OSG_PASSDIR_${PASS}}")
1601 ENDFOREACH(EXTERNAL_CONFIG ${OSG_EXTERNAL_CONFIGS})
1612 COMMAND "${CMAKE_COMMAND}" -E copy
1613 "${CMAKE_SOURCE_DIR}/OSGConfigured.h.cmake"
1614 "${CMAKE_BINARY_DIR}/Source/Base/Base/OSGConfigured.h.tmp.cmake")
1616 FOREACH(_OSG_ADD_CONFIGURE_LINE ${OSG_ADDITIONAL_CONFIGURE_LINES})
1617 FILE(APPEND "${CMAKE_BINARY_DIR}/Source/Base/Base/OSGConfigured.h.tmp.cmake" "\n${_OSG_ADD_CONFIGURE_LINE}\n")
1620 FILE(APPEND "${CMAKE_BINARY_DIR}/Source/Base/Base/OSGConfigured.h.tmp.cmake" "\n#endif // _OSGCONFIGURED_H_\n")
1622 CONFIGURE_FILE("${CMAKE_BINARY_DIR}/Source/Base/Base/OSGConfigured.h.tmp.cmake"
1623 "${CMAKE_BINARY_DIR}/Source/Base/Base/OSGConfigured.h.tmp")
1626 COMMAND "${CMAKE_COMMAND}" -E copy_if_different
1627 "${CMAKE_BINARY_DIR}/Source/Base/Base/OSGConfigured.h.tmp"
1628 "${CMAKE_BINARY_DIR}/Source/Base/Base/OSGConfigured.h")
1634 ADD_CUSTOM_TARGET(OSGAllExamples)
1635 ADD_DEPENDENCIES(OSGAll OSGAllExamples)
1637 IF(OSGBUILD_EXAMPLES_SIMPLE)
1638 ADD_CUSTOM_TARGET(OSGAllSimpleExamples)
1639 ADD_SUBDIRECTORY("Examples/Simple")
1640 ADD_DEPENDENCIES(OSGAllExamples OSGAllSimpleExamples)
1641 ENDIF(OSGBUILD_EXAMPLES_SIMPLE)
1647 IF(OSGBUILD_EXAMPLES_ADVANCED)
1648 ADD_CUSTOM_TARGET(OSGAllAdvancedExamples)
1649 ADD_SUBDIRECTORY("Examples/Advanced/DeferredShading")
1650 ADD_SUBDIRECTORY("Examples/Advanced/Character")
1651 ADD_DEPENDENCIES(OSGAllExamples OSGAllAdvancedExamples)
1652 ENDIF(OSGBUILD_EXAMPLES_ADVANCED)
1658 IF(OSGBUILD_EXAMPLES_TUTORIAL)
1659 ADD_CUSTOM_TARGET(OSGAllTutorialExamples)
1660 ADD_SUBDIRECTORY("Examples/Tutorial")
1661 ADD_DEPENDENCIES(OSGAllExamples OSGAllTutorialExamples)
1662 ENDIF(OSGBUILD_EXAMPLES_TUTORIAL)
1668 FOREACH(_OSGCORE_EXT_EXAMPLE_DIR ${OSG_CORE_EXAMPLE_EXTENSIONS})
1669 MESSAGE(STATUS "processing example ext : ${_OSGCORE_EXT_EXAMPLE_DIR}")
1671 IF(EXISTS ${_OSGCORE_EXT_EXAMPLE_DIR}/CMakeLists.Examples.txt)
1672 MESSAGE(STATUS " Found and process ${_OSGCORE_EXT_EXAMPLE_DIR}/CMakeLists.Examples.txt")
1673 INCLUDE(${_OSGCORE_EXT_EXAMPLE_DIR}/CMakeLists.Examples.txt)
1674 ENDIF(EXISTS ${_OSGCORE_EXT_EXAMPLE_DIR}/CMakeLists.Examples.txt)
1675 ENDFOREACH(_OSGCORE_EXT_EXAMPLE_DIR ${OSG_CORE_EXAMPLE_EXTENSIONS})
1681 SET(OSG_DOC_PIPES "")
1683 IF(OSG_DOXY_STDOUT_LOG)
1684 SET(OSG_DOC_PIPES > ${OSG_DOXY_STDOUT_LOG})
1685 ENDIF(OSG_DOXY_STDOUT_LOG)
1687 IF(DOXYGEN_EXECUTABLE)
1688 IF(NOT OSG_GENERATE_SEPARATE_LIB_DOC)
1689 ADD_CUSTOM_TARGET(Doc
1691 COMMAND ${DOXYGEN_EXECUTABLE} ${OSG_DOXY_CONFIGURATION_FILE} ${OSG_DOC_PIPES})
1699 # osg2-config is created from multiple parts (parts 1 and 3 static, part 2
1700 # is generated during the OSGCOLLECT pass.
1702 # substitute variables in static parts
1703 CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/CMake/osg2-config.part1.in"
1704 "${CMAKE_BINARY_DIR}/bin/osg2-config.part1.tmp")
1705 CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/CMake/osg2-config.part3.in"
1706 "${CMAKE_BINARY_DIR}/bin/osg2-config.part3.tmp")
1709 FILE(READ "${CMAKE_BINARY_DIR}/bin/osg2-config.part1.tmp" OSG2_CONFIG_PART1_CONTENT)
1710 FILE(READ "${CMAKE_BINARY_DIR}/bin/osg2-config.part2.tmp" OSG2_CONFIG_PART2_CONTENT)
1711 FILE(READ "${CMAKE_BINARY_DIR}/bin/osg2-config.part3.tmp" OSG2_CONFIG_PART3_CONTENT)
1713 # concatenate final file
1714 FILE(WRITE "${CMAKE_BINARY_DIR}/bin/osg2-config" "${OSG2_CONFIG_PART1_CONTENT}")
1715 FILE(APPEND "${CMAKE_BINARY_DIR}/bin/osg2-config" "${OSG2_CONFIG_PART2_CONTENT}")
1716 FILE(APPEND "${CMAKE_BINARY_DIR}/bin/osg2-config" "${OSG2_CONFIG_PART3_CONTENT}")
1718 FILE(REMOVE "${CMAKE_BINARY_DIR}/bin/osg2-config.part1.tmp")
1719 FILE(REMOVE "${CMAKE_BINARY_DIR}/bin/osg2-config.part2.tmp")
1720 FILE(REMOVE "${CMAKE_BINARY_DIR}/bin/osg2-config.part3.tmp")
1722 INSTALL(PROGRAMS "${CMAKE_BINARY_DIR}/bin/osg2-config"
1724 COMPONENT development_tools)
1730 INSTALL(FILES "${CMAKE_SOURCE_DIR}/CMake/FindOpenSG.cmake"
1731 DESTINATION share/OpenSG/cmake
1732 COMPONENT development_configuration)
1733 INSTALL(FILES "${CMAKE_SOURCE_DIR}/CMake/FindCollada.cmake"
1734 DESTINATION share/OpenSG/cmake
1735 COMPONENT development_configuration)
1736 INSTALL(FILES "${CMAKE_SOURCE_DIR}/CMake/FindOpenEXR.cmake"
1737 DESTINATION share/OpenSG/cmake
1738 COMPONENT development_configuration)
1739 INSTALL(FILES "${CMAKE_SOURCE_DIR}/CMake/FindGLUT_OpenSG.cmake"
1740 DESTINATION share/OpenSG/cmake
1741 COMPONENT development_configuration)
1742 INSTALL(FILES "${CMAKE_SOURCE_DIR}/CMake/FindJPEG_OpenSG.cmake"
1743 DESTINATION share/OpenSG/cmake
1744 COMPONENT development_configuration)
1745 INSTALL(FILES "${CMAKE_SOURCE_DIR}/CMake/FindPNG_OpenSG.cmake"
1746 DESTINATION share/OpenSG/cmake
1747 COMPONENT development_configuration)
1748 INSTALL(FILES "${CMAKE_SOURCE_DIR}/CMake/FindTIFF_OpenSG.cmake"
1749 DESTINATION share/OpenSG/cmake
1750 COMPONENT development_configuration)
1751 INSTALL(FILES "${CMAKE_SOURCE_DIR}/CMake/FindZLIB_OpenSG.cmake"
1752 DESTINATION share/OpenSG/cmake
1753 COMPONENT development_configuration)
1754 INSTALL(FILES "${CMAKE_SOURCE_DIR}/CMake/SetupCompiler.cmake"
1755 DESTINATION share/OpenSG/cmake
1756 COMPONENT development_configuration)
1757 INSTALL(FILES "${CMAKE_SOURCE_DIR}/CMake/UpdateCompiler.cmake"
1758 DESTINATION share/OpenSG/cmake
1759 COMPONENT development_configuration)
1760 INSTALL(FILES "${CMAKE_SOURCE_DIR}/CMake/BuildFunctions.cmake"
1761 DESTINATION share/OpenSG/cmake
1762 COMPONENT development_configuration)
1763 INSTALL(FILES "${CMAKE_SOURCE_DIR}/CMake/ConfigurePackages.cmake"
1764 DESTINATION share/OpenSG/cmake
1765 COMPONENT development_configuration)
1766 INSTALL(FILES "${CMAKE_SOURCE_DIR}/CMake/ExternalProjectHelper.cmake"
1767 DESTINATION share/OpenSG/cmake
1768 COMPONENT development_configuration)
1769 INSTALL(FILES "${CMAKE_SOURCE_DIR}/CMake/OpenSGVersion.cmake"
1770 DESTINATION share/OpenSG/cmake
1771 COMPONENT development_configuration)
1772 INSTALL(FILES "${CMAKE_BINARY_DIR}/OpenSGExtDep.cmake"
1773 DESTINATION share/OpenSG/cmake
1774 COMPONENT development_configuration)
1775 INSTALL(DIRECTORY "${CMAKE_SOURCE_DIR}/Tools/fcd2code"
1777 COMPONENT development_tools
1778 PATTERN "*.pyc" EXCLUDE
1779 PATTERN ".svn" EXCLUDE)
1785 IF(OSGBUILD_PYTHON_BINDINGS)
1786 EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} Python/Helper/genLibOrder.py
1787 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
1788 OUTPUT_VARIABLE _OSG_LIBORDER)
1790 SET(_OSG_PY_MOD_LIST "osg2ModuleList = [\n")
1792 FOREACH(_OSG_LIB ${_OSG_LIBORDER})
1793 STRING(REPLACE "\n" "" _OSG_LIB ${_OSG_LIB})
1794 SET(OSG_PYTHON_ALL_IMPORTS "${OSG_PYTHON_ALL_IMPORTS}from ..${_OSG_LIB} import *\n")
1795 SET(_OSG_PY_MOD_LIST "${_OSG_PY_MOD_LIST} ${_OSG_LIB}Py,\n")
1798 SET(OSG_PYTHON_ALL_IMPORTS "${OSG_PYTHON_ALL_IMPORTS}\n\n${_OSG_PY_MOD_LIST} ]\n\n")
1800 SET(_OSG_GEN_INIT_FILE_IN "${CMAKE_SOURCE_DIR}/Bindings/Python/osg.__init__.py.in")
1801 SET(_OSG_GEN_INIT_FILE_OUT "${CMAKE_SOURCE_DIR}/Bindings/Python/module/__init__.py")
1803 CONFIGURE_FILE("${_OSG_GEN_INIT_FILE_IN}"
1804 "${_OSG_GEN_INIT_FILE_OUT}")
1806 OSG_SYMLINK_CHECKED(${_OSG_GEN_INIT_FILE_OUT}
1807 ${CMAKE_BINARY_DIR}/Python/lib/osg2/osg/__init__.py)
1811 SET(_OSG_TARGET_PYLIBDIR lib/python/${_OSG_ISC}rel/osg2)
1812 SET(_OSG_TARGET_PYLIBDIR_D lib/python/${_OSG_ISC}debug/osg2)
1813 SET(_OSG_TARGET_PYLIBDIR_RN lib/python/${_OSG_ISC}relnoopt/osg2)
1814 SET(_OSG_TARGET_PYLIBDIR_DO lib/python/${_OSG_ISC}debugopt/osg2)
1816 INSTALL(FILES ${_OSG_GEN_INIT_FILE_OUT}
1817 DESTINATION ${_OSG_TARGET_PYLIBDIR}/osg
1818 CONFIGURATIONS Release)
1820 INSTALL(FILES ${_OSG_GEN_INIT_FILE_OUT}
1821 DESTINATION ${_OSG_TARGET_PYLIBDIR_D}/osg
1822 CONFIGURATIONS Debug)
1824 INSTALL(FILES ${_OSG_GEN_INIT_FILE_OUT}
1825 DESTINATION ${_OSG_TARGET_PYLIBDIR_DO}/osg
1826 CONFIGURATIONS DebugOpt)
1828 INSTALL(FILES ${_OSG_GEN_INIT_FILE_OUT}
1829 DESTINATION ${_OSG_TARGET_PYLIBDIR_RN}/osg
1830 CONFIGURATIONS ReleaseNoOpt)
1833 INSTALL(FILES ${CMAKE_SOURCE_DIR}/Bindings/Python/osg2/__init__.py
1834 DESTINATION ${_OSG_TARGET_PYLIBDIR}
1835 CONFIGURATIONS Release)
1837 INSTALL(FILES ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/__init__.py
1838 ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/helpers.py
1839 ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/cored_node.py
1840 ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/fcd_reflector.py
1841 DESTINATION ${_OSG_TARGET_PYLIBDIR}/helpers
1842 CONFIGURATIONS Release)
1845 INSTALL(FILES ${CMAKE_SOURCE_DIR}/Bindings/Python/osg2/__init__.py
1846 DESTINATION ${_OSG_TARGET_PYLIBDIR_D}
1847 CONFIGURATIONS Debug)
1849 INSTALL(FILES ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/__init__.py
1850 ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/helpers.py
1851 ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/cored_node.py
1852 ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/fcd_reflector.py
1853 DESTINATION ${_OSG_TARGET_PYLIBDIR_D}/helpers
1854 CONFIGURATIONS Debug)
1857 INSTALL(FILES ${CMAKE_SOURCE_DIR}/Bindings/Python/osg2/__init__.py
1858 DESTINATION ${_OSG_TARGET_PYLIBDIR_DO}
1859 CONFIGURATIONS DebugOpt)
1861 INSTALL(FILES ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/__init__.py
1862 ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/helpers.py
1863 ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/cored_node.py
1864 ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/fcd_reflector.py
1865 DESTINATION ${_OSG_TARGET_PYLIBDIR_DO}/helpers
1866 CONFIGURATIONS DebugOpt)
1869 INSTALL(FILES ${CMAKE_SOURCE_DIR}/Bindings/Python/osg2/__init__.py
1870 DESTINATION ${_OSG_TARGET_PYLIBDIR_RN}
1871 CONFIGURATIONS ReleaseNoOpt)
1873 INSTALL(FILES ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/__init__.py
1874 ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/helpers.py
1875 ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/cored_node.py
1876 ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/fcd_reflector.py
1877 DESTINATION ${_OSG_TARGET_PYLIBDIR_RN}/helpers
1878 CONFIGURATIONS ReleaseNoOpt)
1882 GET_FILENAME_COMPONENT(_PY_VERSION_DIR ${PYTHON_INCLUDE_PATH} NAME)
1883 SET(_OSG_PY_INST_BASE
1884 "lib${OSG_LIBDIR_BASE_SUFFIX}/${_PY_VERSION_DIR}/site-packages/${OSG_LIBDIR_BUILD_TYPE_SUFFIX}/osg2")
1886 INSTALL(FILES ${_OSG_GEN_INIT_FILE_OUT}
1887 DESTINATION ${_OSG_PY_INST_BASE}/osg)
1889 INSTALL(FILES ${CMAKE_SOURCE_DIR}/Bindings/Python/osg2/__init__.py
1890 DESTINATION ${_OSG_PY_INST_BASE})
1892 INSTALL(FILES ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/__init__.py
1893 ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/helpers.py
1894 ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/cored_node.py
1895 ${CMAKE_SOURCE_DIR}/Bindings/Python/helpers/fcd_reflector.py
1896 DESTINATION ${_OSG_PY_INST_BASE}/helpers)
1905 IF(DOXYGEN_EXECUTABLE)
1906 IF(OSG_INSTALL_DOXYDOC)
1907 INSTALL(DIRECTORY "${OSG_DOXY_HTML_DIR}"
1908 DESTINATION share/OpenSG/documentation
1909 COMPONENT documentation)
1921 INSTALL(DIRECTORY "${CMAKE_SOURCE_DIR}/Examples/CSM"
1922 DESTINATION share/OpenSG/Examples/
1923 COMPONENT examples_basic)
1929 IF(OSGBUILD_ENABLE_PACKAGING)
1931 SET(SYSTEM_SPEC ${CMAKE_HOST_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR})
1933 SET(CPACK_PACKAGE_NAME "OpenSG")
1934 SET(CPACK_PACKAGE_VERSION ${OSG_VERSION})
1935 SET(CPACK_PACKAGE_VERSION_MAJOR ${OSG_VERSION_MAJOR})
1936 SET(CPACK_PACKAGE_VERSION_MINOR ${OSG_VERSION_MINOR})
1937 SET(CPACK_PACKAGE_VERSION_PATCH ${OSG_VERSION_PATCH})
1938 SET(CPACK_PACKAGE_VENDOR "OpenSG")
1939 SET(CPACK_PACKAGE_CONTACT "Dirk Reiners <dirk@www.opensg.org>")
1940 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenSG is a portable scenegraph system to create realtime 3D graphics programs")
1941 SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
1942 SET(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${OSG_VERSION}-${SYSTEM_SPEC}-${CMAKE_BUILD_TYPE}")
1944 if (EXISTS "${CMAKE_SOURCE_DIR}/README.txt")
1945 set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.txt")
1946 set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.txt")
1949 if (EXISTS "${CMAKE_SOURCE_DIR}/Welcome.txt")
1950 set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_SOURCE_DIR}/Welcome.txt")
1954 SET(CPACK_COMPONENTS_ALL development_tools
1955 development_configuration
1973 SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION "Files needed to execute software with OpenSG.")
1975 SET(CPACK_COMPONENT_DEBUG_RUNTIMES_DISPLAY_NAME "Debug Runtime")
1976 SET(CPACK_COMPONENT_DEBUG_RUNTIMES_DESCRIPTION "Debug Runtimes Libraries Description")
1977 SET(CPACK_COMPONENT_DEBUG_RUNTIMES_GROUP "Runtime")
1978 SET(CPACK_COMPONENT_DEBUG_RUNTIMES_INSTALL_TYPES Full Developer Runtime)
1980 SET(CPACK_COMPONENT_RELEASE_RUNTIMES_DISPLAY_NAME "Release Runtime")
1981 SET(CPACK_COMPONENT_RELEASE_RUNTIMES_DESCRIPTION "Release Runtime Libraries Description")
1982 SET(CPACK_COMPONENT_RELEASE_RUNTIMES_GROUP "Runtime")
1983 SET(CPACK_COMPONENT_RELEASE_RUNTIMES_INSTALL_TYPES Full Developer Runtime)
1986 SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION "Development files needed to develop software with OpenSG.")
1989 SET(CPACK_COMPONENT_RELEASE_LIBRARIES_DISPLAY_NAME "Release Libraries")
1990 SET(CPACK_COMPONENT_RELEASE_LIBRARIES_DESCRIPTION "Release Libraries Description")
1991 SET(CPACK_COMPONENT_RELEASE_LIBRARIES_GROUP "Development")
1992 set(CPACK_COMPONENT_RELEASE_LIBRARIES_INSTALL_TYPES Full Developer)
1994 SET(CPACK_COMPONENT_DEBUG_LIBRARIES_DISPLAY_NAME "Debug Libraries")
1995 SET(CPACK_COMPONENT_DEBUG_LIBRARIES_DESCRIPTION "Debug Libraries Description")
1996 SET(CPACK_COMPONENT_DEBUG_LIBRARIES_GROUP "Development")
1997 SET(CPACK_COMPONENT_DEBUG_LIBRARIES_INSTALL_TYPES Full Developer)
2000 SET(CPACK_COMPONENT_RELEASE_PROGRAM_DB_DISPLAY_NAME "Release Program Database")
2001 SET(CPACK_COMPONENT_RELEASE_PROGRAM_DB_DESCRIPTION "Release Program Database Description")
2002 SET(CPACK_COMPONENT_RELEASE_PROGRAM_DB_GROUP "Development")
2003 SET(CPACK_COMPONENT_RELEASE_PROGRAM_DB_INSTALL_TYPES Full Developer)
2005 SET(CPACK_COMPONENT_DEBUG_PROGRAM_DB_DISPLAY_NAME "Debug Program Database")
2006 SET(CPACK_COMPONENT_DEBUG_PROGRAM_DB_DESCRIPTION "Debug Program Database Description")
2007 SET(CPACK_COMPONENT_DEBUG_PROGRAM_DB_GROUP "Development")
2008 SET(CPACK_COMPONENT_DEBUG_PROGRAM_DB_INSTALL_TYPES Full Developer)
2011 SET(CPACK_COMPONENT_DEVELOPMENT_TOOLS_DISPLAY_NAME "Tools")
2012 SET(CPACK_COMPONENT_DEVELOPMENT_TOOLS_DESCRIPTION "Tools Description")
2013 SET(CPACK_COMPONENT_DEVELOPMENT_TOOLS_GROUP "Development")
2014 SET(CPACK_COMPONENT_DEVELOPMENT_TOOLS_INSTALL_TYPES Full Developer)
2017 SET(CPACK_COMPONENT_DEVELOPMENT_CONFIGURATION_DISPLAY_NAME "Cmake Configuration")
2018 SET(CPACK_COMPONENT_DEVELOPMENT_CONFIGURATION_DESCRIPTION "Cmake files")
2019 SET(CPACK_COMPONENT_DEVELOPMENT_CONFIGURATION_GROUP "Development")
2020 SET(CPACK_COMPONENT_DEVELOPMENT_CONFIGURATION_INSTALL_TYPES Full Developer)
2023 SET(CPACK_COMPONENT_CODE_HEADERS_DISPLAY_NAME "C++ Headers")
2024 SET(CPACK_COMPONENT_CODE_HEADERS_DESCRIPTION "C++ Header, inline, and insert files.")
2025 SET(CPACK_COMPONENT_CODE_HEADERS_GROUP "Development")
2026 SET(CPACK_COMPONENT_CODE_HEADERS_INSTALL_TYPES Full Developer)
2029 SET(CPACK_COMPONENT_GROUP_EXAMPES_DESCRIPTION "OpenSG Examples.")
2031 SET(CPACK_COMPONENT_EXAMPLES_BASIC_DISPLAY_NAME "Simple Examples")
2032 SET(CPACK_COMPONENT_EXAMPLES_BASIC_DESCRIPTION "A Collection of Simple OpenSG Examples")
2033 SET(CPACK_COMPONENT_EXAMPLES_BASIC_GROUP "Examples")
2034 SET(CPACK_COMPONENT_EXAMPLES_BASIC_INSTALL_TYPES Full Developer)
2036 SET(CPACK_COMPONENT_EXAMPLES_ADVANCED_DISPLAY_NAME "Advanced Examples")
2037 SET(CPACK_COMPONENT_EXAMPLES_ADVANCED_DESCRIPTION "A Collection of Advanced OpenSG Examples")
2038 SET(CPACK_COMPONENT_EXAMPLES_ADVANCED_GROUP "Examples")
2039 SET(CPACK_COMPONENT_EXAMPLES_ADVANCED_INSTALL_TYPES Full Developer)
2042 SET(CPACK_COMPONENT_GROUP_DATA_DESCRIPTION "Extra Data files.")
2044 SET(CPACK_COMPONENT_DATA_IMAGES_DISPLAY_NAME "Images")
2045 SET(CPACK_COMPONENT_DATA_IMAGES_DESCRIPTION "OpenSG Images and Icons")
2046 SET(CPACK_COMPONENT_DATA_IMAGES_GROUP "Data")
2047 SET(CPACK_COMPONENT_DATA_IMAGES_INSTALL_TYPES Full Developer Runtime)
2050 SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION "Documentation.")
2056 #NSIS specific configuration
2058 INCLUDE(InstallRequiredSystemLibraries)
2059 IF(OSGBUILD_PACKAGE_TYPE STREQUAL "NSIS")
2060 IF(MSVC AND (${CMAKE_VERSION} VERSION_GREATER "2.8.0" OR
2061 ${CMAKE_VERSION} VERSION_EQUAL "2.8.0" ))
2062 include(CMakeDetermineVSServicePack)
2063 DetermineVSServicePack( my_service_pack )
2065 IF( my_service_pack )
2066 SET(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${OSG_VERSION}-${SYSTEM_SPEC}-${my_service_pack}")
2070 #Extra install commands
2071 SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "")
2072 SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "")
2075 SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/CMake/Packaging/Windows/OpenSG2_Icon.ico")
2076 SET(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/CMake/Packaging/Windows/OpenSG2_Icon.ico")
2077 FILE(TO_NATIVE_PATH "${CMAKE_SOURCE_DIR}/CMake/Packaging/Windows/InstallerHeader.bmp" CPACK_PACKAGE_ICON)
2078 SET(CPACK_NSIS_MODIFY_PATH ON)
2079 SET(CPACK_NSIS_INSTALLED_ICON_NAME "${CPACK_PACKAGE_NAME}")
2080 SET(CPACK_NSIS_HELP_LINK "http://www.opensg.org/wiki/Help")
2081 SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.opensg.org")
2082 SET(CPACK_NSIS_CONTACT "${CPACK_PACKAGE_CONTACT}")
2083 SET(CPACK_NSIS_CREATE_ICONS_EXTRA "createShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${PROJECT_NAME} Directory.lnk' '$INSTDIR'")
2084 SET(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${PROJECT_NAME} Directory.lnk'")
2085 SET(CPACK_NSIS_MENU_LINKS "")
2086 #FILE(TO_NATIVE_PATH "${CMAKE_SOURCE_DIR}/CMake/Packaging/Windows/InstallFinish.bmp" CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP)
2087 #FILE(TO_NATIVE_PATH "${CMAKE_SOURCE_DIR}/CMake/Packaging/Windows/UnInstallFinish.bmp" CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP)
2092 # Date macro by Benoit RAT (www.neub.co.nr)
2093 MACRO (TODAY RESULT)
2095 EXECUTE_PROCESS(COMMAND "date /T" OUTPUT_VARIABLE ${RESULT})
2096 string(REGEX REPLACE "(..)/(..)/..(..).*" "\\3\\2\\1" "${RESULT}" "${${RESULT}}")
2098 EXECUTE_PROCESS(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT})
2099 string(REGEX REPLACE "(..)/(..)/..(..).*" "\\3\\2\\1" "${RESULT}" "${${RESULT}}")
2101 MESSAGE(SEND_ERROR "date not implemented")
2102 SET(${RESULT} 000000)
2108 # Determine package type
2109 IF(OSGBUILD_PACKAGE_TYPE STREQUAL "")
2111 SET(OSGBUILD_PACKAGE_TYPE "ZIP")
2113 SET(OSGBUILD_PACKAGE_TYPE "RPM")
2115 ENDIF(OSGBUILD_PACKAGE_TYPE STREQUAL "")
2117 STRING(TOUPPER ${OSGBUILD_PACKAGE_TYPE} CPACK_GENERATOR)
2119 IF(${CPACK_GENERATOR} STREQUAL "TBZ2")
2120 SET( PACK_EXT "tar.bz2" )
2121 ELSEIF(${CPACK_GENERATOR} STREQUAL "TGZ")
2122 SET( PACK_EXT "tar.gz" )
2124 STRING(TOLOWER ${OSGBUILD_PACKAGE_TYPE} PACK_EXT)
2127 SET(PACKAGE "${CPACK_PACKAGE_FILE_NAME}.${PACK_EXT}")
2128 SET(OUTFILE "${CPACK_PACKAGE_FILE_NAME}-${BUILDNAME}-${DATE}.${PACK_EXT}")
2133 # For some reason using ${CPACK_OUTPUT_FILE_NAME} in here doesn't work, and neither does setting PACKAGE to it. :(
2135 #TODO: Need a way to do this on Windows
2136 #ADD_CUSTOM_TARGET(PackageUpload COMMAND curl -F "code=${OPENSG_UPLOAD_CODE}" -F "quiet=1" -F "out=${OUTFILE}" -F "file=@${PACKAGE}" http://www.opensg.org/htdocs/drop.php )
2137 #ADD_DEPENDENCIES(PackageUpload "${CPACK_OUTPUT_FILE_NAME}")
2139 ADD_CUSTOM_TARGET(PackageUpload COMMAND curl -F "code=${OPENSG_UPLOAD_CODE}" -F "quiet=1" -F "out=${OUTFILE}" -F "file=@${PACKAGE}" http://www.opensg.org/htdocs/drop.php )
2140 ADD_DEPENDENCIES(PackageUpload "${CPACK_OUTPUT_FILE_NAME}")
2144 ENDIF(OSGBUILD_ENABLE_PACKAGING)
2147 SET(CMAKE_CONFIGURATION_TYPES "Debug;Release;DebugOpt;ReleaseNoOpt"
2148 CACHE STRING "OpenSG Build Types" FORCE )
2151 SET(CMAKE_CONFIGURATION_TYPES "Debug;Release;Debug-iphonesimulator;Release-iphonesimulator;Debug-iphoneos;Release-iphoneos"
2152 CACHE STRING "OpenSG Build Types" FORCE )
2156 FILE(APPEND "${CMAKE_BINARY_DIR}/OpenSGExtDep.cmake"
2157 "SET(OSG_DISABLE_MICROSOFT_SECURE_CXXX ${OSG_DISABLE_MICROSOFT_SECURE_CXXX} CACHE INTERNAL \"\" FORCE)\n\n")
2159 FILE(APPEND "${CMAKE_BINARY_DIR}/OpenSGExtDep.cmake"
2160 "SET(OSG_DISABLE_MS_ITERATOR_DEBUGGING ${OSG_DISABLE_MS_ITERATOR_DEBUGGING} CACHE INTERNAL \"\" FORCE)\n\n")
2164 FILE(APPEND "${CMAKE_BINARY_DIR}/OpenSGExtDep.cmake"
2165 "SET(BOOST_ROOT \"${BOOST_ROOT}\" CACHE PATH \"\")\n\n")
2167 FILE(APPEND "${CMAKE_BINARY_DIR}/OpenSGExtDep.cmake"
2168 "SET(OSG_SUPPORT_ROOT \"${OSG_SUPPORT_ROOT}\" CACHE PATH \"\")\n\n")
2170 FILE(APPEND "${CMAKE_BINARY_DIR}/OpenSGExtDep.cmake"
2171 "SET(OSG_USE_OSGSUPPORT_LIBS ${OSG_USE_OSGSUPPORT_LIBS} CACHE BOOL \"\")\n\n")
2174 CUDA_BUILD_CLEAN_TARGET()
2175 ENDIF(OSG_WITH_CUDA)