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 ##############################################
48 ##############################################
51 ADD_SUBDIRECTORY(zlib)
52 ADD_SUBDIRECTORY(libpng)
53 ADD_SUBDIRECTORY(libjpeg)
54 ADD_SUBDIRECTORY(freeglut)
55 ADD_SUBDIRECTORY(glut)
56 ADD_SUBDIRECTORY(libtiff)
57 ADD_SUBDIRECTORY(pcre)
58 # ADD_SUBDIRECTORY(libiconv)
59 ADD_SUBDIRECTORY(libxml2)
60 ADD_SUBDIRECTORY(OpenEXR)
61 ADD_SUBDIRECTORY(expat)
62 ADD_SUBDIRECTORY(gdal)
65 ADD_SUBDIRECTORY(doxygen)
70 ADD_SUBDIRECTORY(glew)
71 ADD_SUBDIRECTORY(collada)
72 ADD_SUBDIRECTORY(opennurbs)
73 ADD_SUBDIRECTORY(libMini)
75 ##############################################
77 ##############################################
79 FILE(GLOB_RECURSE OSG_SUPPORT_CONFIG_FILES RELATIVE "${CMAKE_SOURCE_DIR}"
80 "../Source/Contrib/*CMakeLists.Support.*.txt")
82 FOREACH(OSG_CONTRIB_SUPPORT ${OSG_SUPPORT_CONFIG_FILES})
83 INCLUDE(${OSG_CONTRIB_SUPPORT})
86 ##############################################
88 ##############################################
90 OSG_COMMON_SUPP_EXTERNAL()
92 OSG_COMMON_SUPP_WRITE_CONFIG(OSGSupportConfig.cmake)
94 ##############################################
96 ##############################################
99 CONFIGURE_FILE(CMakeLists.packaging.unix.txt
100 ${CMAKE_BINARY_DIR}/CMakeLists.packaging.txt
103 IF(OSG_DISABLE_MICROSOFT_SECURE_CXXX)
104 SET(OSG_WIN_SEC "nosec")
106 SET(OSG_WIN_SEC "msdefault")
109 CONFIGURE_FILE(CMakeLists.packaging.win.txt
110 ${CMAKE_BINARY_DIR}/CMakeLists.packaging.txt
114 "${CMAKE_SOURCE_DIR}/../CMake/Packaging/Windows/OpenSG2_Icon.ico"
115 DESTINATION share/OpenSG/Packaging
117 PERMISSIONS OWNER_WRITE OWNER_READ
122 "${CMAKE_SOURCE_DIR}/../CMake/Packaging/Windows/InstallerHeader.bmp"
123 DESTINATION share/OpenSG/Packaging
125 PERMISSIONS OWNER_WRITE OWNER_READ
131 INSTALL(FILES ${CMAKE_BINARY_DIR}/CMakeLists.packaging.txt
132 DESTINATION share/OpenSG/Packaging
134 PERMISSIONS OWNER_WRITE OWNER_READ
137 RENAME CMakeLists.txt)
139 INSTALL(FILES ${CMAKE_SOURCE_DIR}/COPYING
140 DESTINATION share/doc/OpenSG
142 PERMISSIONS OWNER_WRITE OWNER_READ
145 RENAME COPYING.support)
147 ##############################################
148 # Component install Setting
149 ##############################################
151 GET_CMAKE_PROPERTY(OSG_COMPONENT_LIST COMPONENTS)
154 ADD_CUSTOM_TARGET(OSG_preinstall
156 WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
160 FOREACH(_OSG_CMP ${OSG_COMPONENT_LIST})
166 COMMAND ${CMAKE_COMMAND} -DCOMPONENT=${_OSG_CMP} -P cmake_install.cmake
167 WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
171 SET(_OSG_CMP_CONF Release)
173 IF(${_OSG_CMP} MATCHES ^debug_)
174 SET(_OSG_CMP_CONF Debug)
179 COMMAND ${CMAKE_COMMAND} -DCOMPONENT=${_OSG_CMP} -DCMAKE_INSTALL_CONFIG_NAME=${_OSG_CMP_CONF} -P cmake_install.cmake
180 WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
185 ADD_DEPENDENCIES(INSTALL_${_OSG_CMP} OSG_preinstall)
195 ADD_CUSTOM_TARGET(INSTALL_runtime)
197 ADD_DEPENDENCIES(INSTALL_runtime INSTALL_libraries)
200 ##############################################
202 ##############################################
205 CUDA_BUILD_CLEAN_TARGET()