1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
5 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
6 "${OpenSGSupport_SOURCE_DIR}/../CMake")
8 ##############################################
9 # Initial cache to make life easier on Windows
10 ##############################################
12 IF(NOT _OSGINITCACHELOADED AND EXISTS ${CMAKE_SOURCE_DIR}/CMakeCacheInitial.txt)
13 GET_FILENAME_COMPONENT(_OSGTMPF "${CMAKE_SOURCE_DIR}/CMakeCacheInitial.txt" REALPATH)
14 GET_FILENAME_COMPONENT(_OSGTMP "${_OSGTMPF}" PATH)
16 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${_OSGTMP}")
17 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${_OSGTMP}/CMake")
18 MESSAGE("xx ${_OSGTMP}")
21 SET(_OSGINITCACHELOADED TRUE CACHE INTERNAL "")
22 ENDIF(NOT _OSGINITCACHELOADED AND EXISTS ${CMAKE_SOURCE_DIR}/CMakeCacheInitial.txt)
24 ##############################################
25 # Disallow in-source build
26 ##############################################
28 IF("${OpenSGSupport_SOURCE_DIR}" STREQUAL "${OpenSGSupport_BINARY_DIR}")
29 MESSAGE(FATAL_ERROR "OpenSGSupport requires an out of source Build. \n"
30 "Please create a separate binary directory and run "
32 ENDIF("${OpenSGSupport_SOURCE_DIR}" STREQUAL "${OpenSGSupport_BINARY_DIR}")
34 ##############################################
36 ##############################################
38 INCLUDE(OSGCommonSupportConfig)
40 OSG_COMMONSUPP_SETUP()
42 INCLUDE(OpenSGVersion)
44 SET(OSG_BUILD_ACTIVE TRUE)
46 FOREACH(_OSG_GLOBAL_DEP_DEF ${OSG_GLOBAL_DEP_DEFS})
47 ADD_DEFINITIONS(-D${_OSG_GLOBAL_DEP_DEF})
48 ENDFOREACH(_OSG_GLOBAL_DEP_DEF)
50 ##############################################
52 ##############################################
55 ADD_SUBDIRECTORY(zlib)
56 ADD_SUBDIRECTORY(libpng)
57 ADD_SUBDIRECTORY(libjpeg)
58 ADD_SUBDIRECTORY(freeglut)
59 ADD_SUBDIRECTORY(glut)
60 ADD_SUBDIRECTORY(libtiff)
61 ADD_SUBDIRECTORY(pcre)
62 # ADD_SUBDIRECTORY(libiconv)
63 ADD_SUBDIRECTORY(libxml2)
64 ADD_SUBDIRECTORY(OpenEXR)
65 ADD_SUBDIRECTORY(expat)
66 ADD_SUBDIRECTORY(gdal)
69 ADD_SUBDIRECTORY(doxygen)
74 ADD_SUBDIRECTORY(glew)
75 ADD_SUBDIRECTORY(collada)
76 ADD_SUBDIRECTORY(opennurbs)
77 ADD_SUBDIRECTORY(libMini)
79 ##############################################
81 ##############################################
83 FILE(GLOB_RECURSE OSG_SUPPORT_CONFIG_FILES RELATIVE "${CMAKE_SOURCE_DIR}"
84 "../Source/Contrib/*CMakeLists.Support.*.txt")
86 FOREACH(OSG_CONTRIB_SUPPORT ${OSG_SUPPORT_CONFIG_FILES})
87 INCLUDE(${OSG_CONTRIB_SUPPORT})
90 ##############################################
92 ##############################################
94 OSG_COMMON_SUPP_EXTERNAL()
96 OSG_COMMON_SUPP_WRITE_CONFIG(OSGSupportConfig.cmake)
98 ##############################################
100 ##############################################
103 CONFIGURE_FILE(CMakeLists.packaging.unix.txt
104 ${CMAKE_BINARY_DIR}/CMakeLists.packaging.txt
107 IF(OSG_DISABLE_MICROSOFT_SECURE_CXXX)
108 SET(OSG_WIN_SEC "nosec")
110 SET(OSG_WIN_SEC "msdefault")
113 CONFIGURE_FILE(CMakeLists.packaging.win.txt
114 ${CMAKE_BINARY_DIR}/CMakeLists.packaging.txt
118 "${CMAKE_SOURCE_DIR}/../CMake/Packaging/Windows/OpenSG2_Icon.ico"
119 DESTINATION share/OpenSG/Packaging
121 PERMISSIONS OWNER_WRITE OWNER_READ
126 "${CMAKE_SOURCE_DIR}/../CMake/Packaging/Windows/InstallerHeader.bmp"
127 DESTINATION share/OpenSG/Packaging
129 PERMISSIONS OWNER_WRITE OWNER_READ
135 INSTALL(FILES ${CMAKE_BINARY_DIR}/CMakeLists.packaging.txt
136 DESTINATION share/OpenSG/Packaging
138 PERMISSIONS OWNER_WRITE OWNER_READ
141 RENAME CMakeLists.txt)
143 INSTALL(FILES ${CMAKE_SOURCE_DIR}/COPYING
144 DESTINATION share/doc/OpenSG
146 PERMISSIONS OWNER_WRITE OWNER_READ
149 RENAME COPYING.support)
151 ##############################################
152 # Component install Setting
153 ##############################################
155 GET_CMAKE_PROPERTY(OSG_COMPONENT_LIST COMPONENTS)
158 ADD_CUSTOM_TARGET(OSG_preinstall
160 WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
164 FOREACH(_OSG_CMP ${OSG_COMPONENT_LIST})
170 COMMAND ${CMAKE_COMMAND} -DCOMPONENT=${_OSG_CMP} -P cmake_install.cmake
171 WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
175 SET(_OSG_CMP_CONF Release)
177 IF(${_OSG_CMP} MATCHES ^debug_)
178 SET(_OSG_CMP_CONF Debug)
183 COMMAND ${CMAKE_COMMAND} -DCOMPONENT=${_OSG_CMP} -DCMAKE_INSTALL_CONFIG_NAME=${_OSG_CMP_CONF} -P cmake_install.cmake
184 WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
189 ADD_DEPENDENCIES(INSTALL_${_OSG_CMP} OSG_preinstall)
199 ADD_CUSTOM_TARGET(INSTALL_runtime)
201 ADD_DEPENDENCIES(INSTALL_runtime INSTALL_libraries)
204 ##############################################
206 ##############################################
209 CUDA_BUILD_CLEAN_TARGET()