2 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
6 IF("${${PROJECT_NAME}_SOURCE_DIR}" STREQUAL "${${PROJECT_NAME}_BINARY_DIR}")
7 MESSAGE(FATAL_ERROR "OpenSG requires an out of source Build. \n"
8 "Please create a separate binary directory and run "
10 ENDIF("${${PROJECT_NAME}_SOURCE_DIR}" STREQUAL "${${PROJECT_NAME}_BINARY_DIR}")
12 IF(CMAKE_INSTALL_PREFIX STREQUAL /usr/local OR WIN32)
13 SET(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/Pack.install
21 STRING(REGEX REPLACE /[^/]*/[^/]*/[^/]*$ "" _BASE_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR})
23 #MESSAGE("BASE DIR : ${_BASE_INSTALL_DIR}")
29 FILE(GLOB_RECURSE _${PROJECT_NAME}_INCLUDES
30 RELATIVE ${_BASE_INSTALL_DIR}
31 ${_BASE_INSTALL_DIR}/include/*)
33 FOREACH(_INCLUDE_ELEM ${_${PROJECT_NAME}_INCLUDES})
35 STRING(REGEX REPLACE /[^/]*$ "" _INST_PATH ${_INCLUDE_ELEM})
37 # MESSAGE("INC : ${_INCLUDE_ELEM} headers")
39 INSTALL(FILES ${_BASE_INSTALL_DIR}/${_INCLUDE_ELEM}
40 DESTINATION ${_INST_PATH}
41 PERMISSIONS OWNER_WRITE OWNER_READ
52 FILE(GLOB_RECURSE _${PROJECT_NAME}_LIBS
53 RELATIVE ${_BASE_INSTALL_DIR}
54 ${_BASE_INSTALL_DIR}/lib@OSG_LIBDIR_BASE_SUFFIX@/*)
57 FOREACH(_LIB_ELEM ${_${PROJECT_NAME}_LIBS})
59 STRING(REGEX REPLACE /[^/]*$ "" _INST_PATH ${_LIB_ELEM})
61 SET(_ELEM_COMPONENT libraries_release)
63 IF(${_LIB_ELEM} MATCHES [dD]\\.lib$)
64 SET(_ELEM_COMPONENT libraries_debug)
65 ELSEIF(${_LIB_ELEM} MATCHES [dD][oO]\\.lib$)
66 SET(_ELEM_COMPONENT libraries_debugopt)
67 ELSEIF(${_LIB_ELEM} MATCHES [rR][nN]\\.lib$)
68 SET(_ELEM_COMPONENT libraries_releasenoopt)
69 ELSEIF(${_LIB_ELEM} MATCHES /python/rel/)
70 SET(_ELEM_COMPONENT python_release)
71 ELSEIF(${_LIB_ELEM} MATCHES /python/relnoopt/)
72 SET(_ELEM_COMPONENT python_releasenoopt)
73 ELSEIF(${_LIB_ELEM} MATCHES /python/debugopt/)
74 SET(_ELEM_COMPONENT python_debugopt)
75 ELSEIF(${_LIB_ELEM} MATCHES /python/debug/)
76 SET(_ELEM_COMPONENT python_debug)
79 # MESSAGE("LIB : ${_LIB_ELEM} ${_ELEM_COMPONENT} ${_INST_PATH}")
81 INSTALL(FILES ${_BASE_INSTALL_DIR}/${_LIB_ELEM}
82 DESTINATION ${_INST_PATH}
83 PERMISSIONS OWNER_WRITE OWNER_READ
86 COMPONENT ${_ELEM_COMPONENT})
95 FILE(GLOB_RECURSE _${PROJECT_NAME}_BIN
96 RELATIVE ${_BASE_INSTALL_DIR}
97 ${_BASE_INSTALL_DIR}/bin/*)
99 FOREACH(_BIN_ELEM ${_${PROJECT_NAME}_BIN})
101 STRING(REGEX REPLACE /[^/]*$ "" _INST_PATH ${_BIN_ELEM})
103 SET(_ELEM_COMPONENT runtime_release)
105 IF(${_BIN_ELEM} MATCHES bin/debug/.*\\.dll$)
106 SET(_ELEM_COMPONENT runtime_debug)
107 ELSEIF(${_BIN_ELEM} MATCHES bin/debugopt/.*\\.dll$)
108 SET(_ELEM_COMPONENT runtime_debugopt)
109 ELSEIF(${_BIN_ELEM} MATCHES bin/relnoopt/.*\\.dll$)
110 SET(_ELEM_COMPONENT runtime_releasenoopt)
111 ELSEIF(${_BIN_ELEM} MATCHES bin/rel/.*\\.exe$)
112 SET(_ELEM_COMPONENT app_release)
113 ELSEIF(${_BIN_ELEM} MATCHES bin/relnoopt/.*\\.exe$)
114 SET(_ELEM_COMPONENT app_releasenoopt)
115 ELSEIF(${_BIN_ELEM} MATCHES bin/debugopt/.*\\.exe$)
116 SET(_ELEM_COMPONENT app_debugopt)
117 ELSEIF(${_BIN_ELEM} MATCHES bin/debug/.*\\.exe$)
118 SET(_ELEM_COMPONENT app_debug)
119 ELSEIF(${_BIN_ELEM} MATCHES bin/fcd2code/)
120 SET(_ELEM_COMPONENT development_tools)
121 ELSEIF(${_BIN_ELEM} MATCHES bin/[^/]*$)
122 SET(_ELEM_COMPONENT development_tools)
125 # MESSAGE("BIN : ${_BIN_ELEM} ${_ELEM_COMPONENT} ${_INST_PATH}")
127 INSTALL(FILES ${_BASE_INSTALL_DIR}/${_BIN_ELEM}
128 DESTINATION ${_INST_PATH}
129 PERMISSIONS OWNER_WRITE OWNER_READ
132 COMPONENT ${_ELEM_COMPONENT})
141 FILE(GLOB_RECURSE _${PROJECT_NAME}_SHARE
142 RELATIVE ${_BASE_INSTALL_DIR}
143 ${_BASE_INSTALL_DIR}/share/*)
145 #MESSAGE("SHARE IN : ${_${PROJECT_NAME}_SHARE}")
147 FOREACH(_SHARE_ELEM ${_${PROJECT_NAME}_SHARE})
149 STRING(REGEX REPLACE /[^/]*$ "" _INST_PATH ${_SHARE_ELEM})
151 SET(_ELEM_COMPONENT Unknown)
153 IF(NOT ${_INST_PATH} MATCHES /Packaging)
155 IF(${_INST_PATH} MATCHES /cmake)
156 SET(_ELEM_COMPONENT development_config)
159 IF(${_INST_PATH} MATCHES /share/doc)
160 SET(_ELEM_COMPONENT runtime_release)
163 IF(${_INST_PATH} MATCHES /Doc)
164 SET(_ELEM_COMPONENT doc)
167 IF(${_INST_PATH} MATCHES /Doc$)
168 SET(BASE_DOC_DIR ${_INST_PATH})
171 IF(${_INST_PATH} MATCHES /Examples/)
172 IF(${_INST_PATH} MATCHES /bin/rel$)
173 SET(_ELEM_COMPONENT examples_release)
174 ELSEIF(${_INST_PATH} MATCHES /bin/relnoopt)
175 SET(_ELEM_COMPONENT examples_releasenoopt)
176 ELSEIF(${_INST_PATH} MATCHES /bin/debugopt$)
177 SET(_ELEM_COMPONENT examples_debugopt)
178 ELSEIF(${_INST_PATH} MATCHES /bin/debug$)
179 SET(_ELEM_COMPONENT examples_debug)
180 ELSEIF(${_INST_PATH} MATCHES /CSM/)
181 SET(_ELEM_COMPONENT app_data)
183 SET(_ELEM_COMPONENT example_projects)
187 # MESSAGE("SHARE : ${_SHARE_ELEM} ${_ELEM_COMPONENT} ${_INST_PATH}")
189 INSTALL(FILES ${_BASE_INSTALL_DIR}/${_SHARE_ELEM}
190 DESTINATION ${_INST_PATH}
191 PERMISSIONS OWNER_WRITE OWNER_READ
194 COMPONENT ${_ELEM_COMPONENT})
199 STRING(REGEX REPLACE ".*\\.(fc[1-9][0-9])\\..*" "\\1"
200 _OSG_FC_VERSION ${CMAKE_SYSTEM_VERSION})
202 SET(OSG_HOST_SYSTEM_NAME ${CMAKE_HOST_SYSTEM_NAME})
205 SET(OSG_HOST_SYSTEM_NAME ${_OSG_FC_VERSION})
209 SET(OSG_HOST_SYSTEM_NAME "win")
213 SET(OSG_HOST_SYSTEM_PROCESSOR x86_64)
215 SET(OSG_HOST_SYSTEM_PROCESSOR 32)
218 SET(SYSTEM_SPEC ${OSG_HOST_SYSTEM_NAME}.${OSG_HOST_SYSTEM_PROCESSOR})
220 # Date macro by Benoit RAT (www.neub.co.nr)
223 EXECUTE_PROCESS(COMMAND "cmd" "/C date /T" OUTPUT_VARIABLE ${RESULT})
224 # string(REGEX REPLACE "(..)/(..)/..(..).*" "\\3\\2\\1" "${RESULT}" "${${RESULT}}")
225 string(REGEX REPLACE "([a-zA-Z]+ )(..)/(..)/..(..).*" "\\2_\\3_20\\4" "${RESULT}" "${${RESULT}}")
227 EXECUTE_PROCESS(COMMAND "date" "+%d_%m_%Y" OUTPUT_VARIABLE ${RESULT})
228 # string(REGEX REPLACE "(..)_(..)_..(..).*" "\\1_\\2_\\3" "${RESULT}" "${${RESULT}}")
229 string(REGEX REPLACE "\n" "" "${RESULT}" "${${RESULT}}")
231 MESSAGE(SEND_ERROR "date not implemented")
232 SET(${RESULT} 000000)
237 SET(DATE ${OSG_BUILD_DATE})
239 IF(${CMAKE_VERSION} VERSION_GREATER "3.0.0")
240 STRING(TIMESTAMP DATE "%d.%m.%Y")
246 MESSAGE("XXXX ${DATE}")
248 SET(CPACK_PACKAGE_NAME "OpenSG")
249 SET(CPACK_PACKAGE_VERSION @OSG_VERSION@)
250 SET(CPACK_PACKAGE_VERSION_MAJOR @OSG_VERSION_MAJOR@)
251 SET(CPACK_PACKAGE_VERSION_MINOR @OSG_VERSION_MINOR@)
252 SET(CPACK_PACKAGE_VERSION_PATCH @OSG_VERSION_PATCH@)
253 SET(CPACK_PACKAGE_VENDOR "OpenSG")
254 SET(CPACK_PACKAGE_CONTACT "Dirk Reiners <dirk@www.opensg.org>")
255 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenSG provides the OpenSG scene graph system")
256 SET(CPACK_RESOURCE_FILE_LICENSE "${_BASE_INSTALL_DIR}/share/doc/OpenSG/COPYING")
258 SET(CPACK_COMPONENTS_GROUPING ONE_PER_GROUP)
260 IF(NOT OSG_SINGLE_PACKAGE)
261 SET(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
262 SET(CPACK_RPM_COMPONENT_INSTALL ON)
265 SET(CPACK_PACKAGE_FILE_NAME "OpenSG.@OSG_VERSION@.${DATE}.${SYSTEM_SPEC}.@OSG_WIN_SEC@")
267 SET(OSGBUILD_PACKAGE_TYPE "ZIP" CACHE STRING "")
269 IF(NOT OSGBUILD_PACKAGE_TYPE OR OSGBUILD_PACKAGE_TYPE STREQUAL "")
271 SET(OSGBUILD_PACKAGE_TYPE "ZIP")
273 SET(OSGBUILD_PACKAGE_TYPE "TBZ2")
277 STRING(TOUPPER ${OSGBUILD_PACKAGE_TYPE} CPACK_GENERATOR)
279 SET(CPACK_COMPONENTS_ALL libraries_release
280 libraries_releasenoopt
304 examples_releasenoopt
311 SET(CPACK_COMPONENT_GROUP_RUNTIME_DESCRIPTION "Suport Files needed to execute software with OpenSG.")
312 SET(CPACK_COMPONENT_GROUP_EXAMPLES_DESCRIPTION "Examples Files needed illustrate software using OpenSG.")
313 SET(CPACK_COMPONENT_GROUP_DEVEL_DESCRIPTION "Development support files needed to develop software with OpenSG.")
319 SET(CPACK_COMPONENT_LIBRARIES_RELEASE_DISPLAY_NAME "Support Release Libraries")
320 SET(CPACK_COMPONENT_LIBRARIES_RELEASE_DESCRIPTION "Support Release Libraries Description")
321 SET(CPACK_COMPONENT_LIBRARIES_RELEASE_GROUP "devel")
322 SET(CPACK_COMPONENT_LIBRARIES_RELEASE_INSTALL_TYPES Full Developer)
324 SET(CPACK_COMPONENT_LIBRARIES_RELEASENOOPT_DISPLAY_NAME "Support Release No Opt Libraries")
325 SET(CPACK_COMPONENT_LIBRARIES_RELEASENOOPT_DESCRIPTION "Support Release No Opt Libraries Description")
326 SET(CPACK_COMPONENT_LIBRARIES_RELEASENOOPT_GROUP "devel")
327 SET(CPACK_COMPONENT_LIBRARIES_RELEASENOOPT_INSTALL_TYPES Full Developer)
329 SET(CPACK_COMPONENT_LIBRARIES_DEBUG_DISPLAY_NAME "Support Debug Libraries")
330 SET(CPACK_COMPONENT_LIBRARIES_DEBUG_DESCRIPTION "Support Debug Libraries Description")
331 SET(CPACK_COMPONENT_LIBRARIES_DEBUG_GROUP "devel")
332 SET(CPACK_COMPONENT_LIBRARIES_DEBUG_INSTALL_TYPES Full Developer)
334 SET(CPACK_COMPONENT_LIBRARIES_DEBUGOPT_DISPLAY_NAME "Support Debug Opt Libraries")
335 SET(CPACK_COMPONENT_LIBRARIES_DEBUGOPT_DESCRIPTION "Support Debug Opt Libraries Description")
336 SET(CPACK_COMPONENT_LIBRARIES_DEBUGOPT_GROUP "devel")
337 SET(CPACK_COMPONENT_LIBRARIES_DEBUGOPT_INSTALL_TYPES Full Developer)
343 SET(CPACK_COMPONENT_PYTHON_RELEASE_DISPLAY_NAME "Support Release Runtime")
344 SET(CPACK_COMPONENT_PYTHON_RELEASE_DESCRIPTION "Support Release Runtime Libraries Description")
345 SET(CPACK_COMPONENT_PYTHON_RELEASE_GROUP "runtime")
346 SET(CPACK_COMPONENT_PYTHON_RELEASE_INSTALL_TYPES Full Developer Runtime)
348 SET(CPACK_COMPONENT_PYTHON_RELEASENOOPT_DISPLAY_NAME "Support Release Runtime")
349 SET(CPACK_COMPONENT_PYTHON_RELEASENOOPT_DESCRIPTION "Support Release Runtime Libraries Description")
350 SET(CPACK_COMPONENT_PYTHON_RELEASENOOPT_GROUP "devel")
351 SET(CPACK_COMPONENT_PYTHON_RELEASENOOPT_INSTALL_TYPES Full Developer)
353 SET(CPACK_COMPONENT_PYTHON_DEBUG_DISPLAY_NAME "Support Debug Runtime")
354 SET(CPACK_COMPONENT_PYTHON_DEBUG_DESCRIPTION "Support Debug Runtimes Libraries Description")
355 SET(CPACK_COMPONENT_PYTHON_DEBUG_GROUP "devel")
356 SET(CPACK_COMPONENT_PYTHON_DEBUG_INSTALL_TYPES Full Developer)
358 SET(CPACK_COMPONENT_PYTHON_DEBUGOPT_DISPLAY_NAME "Support Debug Runtime")
359 SET(CPACK_COMPONENT_PYTHON_DEBUGOPT_DESCRIPTION "Support Debug Runtimes Libraries Description")
360 SET(CPACK_COMPONENT_PYTHON_DEBUGOPT_GROUP "devel")
361 SET(CPACK_COMPONENT_PYTHON_DEBUGOPT_INSTALL_TYPES Full Developer)
367 SET(CPACK_COMPONENT_RUNTIME_RELEASE_DISPLAY_NAME "Support Release Runtime")
368 SET(CPACK_COMPONENT_RUNTIME_RELEASE_DESCRIPTION "Support Release Runtime Libraries Description")
369 SET(CPACK_COMPONENT_RUNTIME_RELEASE_GROUP "runtime")
370 SET(CPACK_COMPONENT_RUNTIME_RELEASE_INSTALL_TYPES Full Developer Runtime)
372 SET(CPACK_COMPONENT_RUNTIME_RELEASENOOPT_DISPLAY_NAME "Support Release Runtime")
373 SET(CPACK_COMPONENT_RUNTIME_RELEASENOOPT_DESCRIPTION "Support Release Runtime Libraries Description")
374 SET(CPACK_COMPONENT_RUNTIME_RELEASENOOPT_GROUP "devel")
375 SET(CPACK_COMPONENT_RUNTIME_RELEASENOOPT_INSTALL_TYPES Full Developer)
377 SET(CPACK_COMPONENT_RUNTIME_DEBUG_DISPLAY_NAME "Support Debug Runtime")
378 SET(CPACK_COMPONENT_RUNTIME_DEBUG_DESCRIPTION "Support Debug Runtimes Libraries Description")
379 SET(CPACK_COMPONENT_RUNTIME_DEBUG_GROUP "devel")
380 SET(CPACK_COMPONENT_RUNTIME_DEBUG_INSTALL_TYPES Full Developer)
382 SET(CPACK_COMPONENT_RUNTIME_DEBUGOPT_DISPLAY_NAME "Support Debug Runtime")
383 SET(CPACK_COMPONENT_RUNTIME_DEBUGOPT_DESCRIPTION "Support Debug Runtimes Libraries Description")
384 SET(CPACK_COMPONENT_RUNTIME_DEBUGOPT_GROUP "devel")
385 SET(CPACK_COMPONENT_RUNTIME_DEBUGOPT_INSTALL_TYPES Full Developer)
391 SET(CPACK_COMPONENT_APP_RELEASE_DISPLAY_NAME "Support Apps Release Runtime")
392 SET(CPACK_COMPONENT_APP_RELEASE_DESCRIPTION "Support Apps Release Runtime Libraries Description")
393 SET(CPACK_COMPONENT_APP_RELEASE_GROUP "runtime")
394 SET(CPACK_COMPONENT_APP_RELEASE_INSTALL_TYPES Full Developer Runtime)
396 SET(CPACK_COMPONENT_APP_DATA_DISPLAY_NAME "Support Apps Data")
397 SET(CPACK_COMPONENT_APP_DATA_DESCRIPTION "Support Apps Data Description")
398 SET(CPACK_COMPONENT_APP_DATA_GROUP "runtime")
399 SET(CPACK_COMPONENT_APP_DATA_INSTALL_TYPES Full Developer Runtime)
401 SET(CPACK_COMPONENT_APP_RELEASENOOPT_DISPLAY_NAME "Support Apps Release Runtime")
402 SET(CPACK_COMPONENT_APP_RELEASENOOPT_DESCRIPTION "Support Apps Release Runtime Libraries Description")
403 SET(CPACK_COMPONENT_APP_RELEASENOOPT_GROUP "devel")
404 SET(CPACK_COMPONENT_APP_RELEASENOOPT_INSTALL_TYPES Full Developer)
406 SET(CPACK_COMPONENT_APP_DEBUG_DISPLAY_NAME "Support Apps Debug Runtime")
407 SET(CPACK_COMPONENT_APP_DEBUG_DESCRIPTION "Support Apps Debug Runtimes Libraries Description")
408 SET(CPACK_COMPONENT_APP_DEBUG_GROUP "devel")
409 SET(CPACK_COMPONENT_APP_DEBUG_INSTALL_TYPES Full Developer)
411 SET(CPACK_COMPONENT_APP_DEBUGOPT_DISPLAY_NAME "Support Apps Debug Runtime")
412 SET(CPACK_COMPONENT_APP_DEBUGOPT_DESCRIPTION "Support Apps Debug Runtimes Libraries Description")
413 SET(CPACK_COMPONENT_APP_DEBUGOPT_GROUP "devel")
414 SET(CPACK_COMPONENT_APP_DEBUGOPT_INSTALL_TYPES Full Developer)
420 SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Support Headers")
421 SET(CPACK_COMPONENT_HEADERS_DESCRIPTION "Support Headers Description")
422 SET(CPACK_COMPONENT_HEADERS_GROUP "devel")
423 SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Full Developer)
425 SET(CPACK_COMPONENT_DEVELOPMENT_TOOLS_DISPLAY_NAME "Support Dev Tools")
426 SET(CPACK_COMPONENT_DEVELOPMENT_TOOLS_DESCRIPTION "Support Dev Tools Description")
427 SET(CPACK_COMPONENT_DEVELOPMENT_TOOLS_GROUP "devel")
428 SET(CPACK_COMPONENT_DEVELOPMENT_TOOLS_INSTALL_TYPES Full Developer)
430 SET(CPACK_COMPONENT_DEVELOPMENT_CONFIG_DISPLAY_NAME "Support Dev Config")
431 SET(CPACK_COMPONENT_DEVELOPMENT_CONFIG_DESCRIPTION "Support Dev Config Description")
432 SET(CPACK_COMPONENT_DEVELOPMENT_CONFIG_GROUP "devel")
433 SET(CPACK_COMPONENT_DEVELOPMENT_CONFIG_INSTALL_TYPES Full Developer)
435 SET(CPACK_COMPONENT_EXAMPLE_PROJECTS_DISPLAY_NAME "Support Dev Config")
436 SET(CPACK_COMPONENT_EXAMPLE_PROJECTS_DESCRIPTION "Support Dev Config Description")
437 SET(CPACK_COMPONENT_EXAMPLE_PROJECTS_GROUP "devel")
438 SET(CPACK_COMPONENT_EXAMPLE_PROJECTS_INSTALL_TYPES Full Developer)
444 SET(CPACK_COMPONENT_EXAMPLES_RELEASE_DISPLAY_NAME "Support Examples Release Runtime")
445 SET(CPACK_COMPONENT_EXAMPLES_RELEASE_DESCRIPTION "Support Examples Release Runtime Libraries Description")
446 SET(CPACK_COMPONENT_EXAMPLES_RELEASE_GROUP "devel")
447 SET(CPACK_COMPONENT_EXAMPLES_RELEASE_INSTALL_TYPES Full Developer Runtime)
449 SET(CPACK_COMPONENT_EXAMPLES_RELEASENOOPT_DISPLAY_NAME "Support Examples Release Runtime")
450 SET(CPACK_COMPONENT_EXAMPLES_RELEASENOOPT_DESCRIPTION "Support Examples Release Runtime Libraries Description")
451 SET(CPACK_COMPONENT_EXAMPLES_RELEASENOOPT_GROUP "devel")
452 SET(CPACK_COMPONENT_EXAMPLES_RELEASENOOPT_INSTALL_TYPES Full Developer)
454 SET(CPACK_COMPONENT_EXAMPLES_DEBUG_DISPLAY_NAME "Support Examples Debug Runtime")
455 SET(CPACK_COMPONENT_EXAMPLES_DEBUG_DESCRIPTION "Support Examples Debug Runtimes Libraries Description")
456 SET(CPACK_COMPONENT_EXAMPLES_DEBUG_GROUP "devel")
457 SET(CPACK_COMPONENT_EXAMPLES_DEBUG_INSTALL_TYPES Full Developer)
459 SET(CPACK_COMPONENT_EXAMPLES_DEBUGOPT_DISPLAY_NAME "Support Examples Debug Runtime")
460 SET(CPACK_COMPONENT_EXAMPLES_DEBUGOPT_DESCRIPTION "Support Examples Debug Runtimes Libraries Description")
461 SET(CPACK_COMPONENT_EXAMPLES_DEBUGOPT_GROUP "devel")
462 SET(CPACK_COMPONENT_EXAMPLES_DEBUGOPT_INSTALL_TYPES Full Developer)
465 #NSIS specific configuration
467 INCLUDE(InstallRequiredSystemLibraries)
468 IF(OSGBUILD_PACKAGE_TYPE STREQUAL "NSIS")
469 # IF(MSVC AND (${CMAKE_VERSION} VERSION_GREATER "2.8.0" OR
470 # ${CMAKE_VERSION} VERSION_EQUAL "2.8.0" ))
471 # INCLUDE(CMakeDetermineVSServicePack)
472 # DetermineVSServicePack( my_service_pack )
474 # IF(my_service_pack)
475 # SET(CPACK_PACKAGE_FILE_NAME "OpenSG.@OSG_VERSION@.${DATE}.${SYSTEM_SPEC}.${my_service_pack}.@OSG_WIN_SEC@")
479 STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" CXX_COMPILER_VERSION_MAJOR "${CMAKE_CXX_COMPILER_VERSION}")
480 STRING(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" CXX_COMPILER_VERSION_MINOR "${CMAKE_CXX_COMPILER_VERSION}")
481 STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" CXX_COMPILER_VERSION_PATCH "${CMAKE_CXX_COMPILER_VERSION}")
483 SET(CPACK_PACKAGE_FILE_NAME "OpenSG.@OSG_VERSION@.${DATE}.${SYSTEM_SPEC}.cl${CXX_COMPILER_VERSION_MAJOR}.@OSG_WIN_SEC@")
485 #Extra install commands
486 SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "")
487 SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "")
490 SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/OpenSG2_Icon.ico")
491 SET(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/OpenSG2_Icon.ico")
492 FILE(TO_NATIVE_PATH "${CMAKE_SOURCE_DIR}\\InstallerHeader.bmp" WS_CPACK_PACKAGE_ICON)
493 STRING(REPLACE "\\" "\\\\\\\\" CPACK_PACKAGE_ICON ${WS_CPACK_PACKAGE_ICON})
494 SET(CPACK_NSIS_MODIFY_PATH ON)
495 SET(CPACK_NSIS_INSTALLED_ICON_NAME "${CPACK_PACKAGE_NAME}")
496 SET(CPACK_NSIS_HELP_LINK "http://www.opensg.org/wiki/Help")
497 SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.opensg.org")
498 SET(CPACK_NSIS_CONTACT "${CPACK_PACKAGE_CONTACT}")
499 SET(CPACK_NSIS_CREATE_ICONS_EXTRA "createShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${PROJECT_NAME} Directory.lnk' '$INSTDIR'")
500 SET(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${PROJECT_NAME} Directory.lnk'")
501 SET(CPACK_NSIS_MENU_LINKS "")
503 IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
504 SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
506 SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES32")
512 MESSAGE("FOOO ${CPACK_PACKAGE_FILE_NAME}")