fixed: compile issue
[opensg.git] / CMake / CMakeLists.packaging.win.txt
blobfe4a17e29059ef67b065fb2ab2271ac758353e86
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
4 PROJECT(OpenSGPack)
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 "
9                       "CMake there.")
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 
14                            CACHE PATH "" FORCE)
15 ENDIF()
17 ################
18 # Ref Dir
19 ################
21 STRING(REGEX REPLACE /[^/]*/[^/]*/[^/]*$ "" _BASE_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR})
23 #MESSAGE("BASE DIR : ${_BASE_INSTALL_DIR}")
25 ################
26 # includes 
27 ################
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
42                             GROUP_READ
43                             WORLD_READ
44                 COMPONENT headers)
46 ENDFOREACH()
48 ################
49 # libs 
50 ################
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)
77   ENDIF()
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
84                             GROUP_READ
85                             WORLD_READ
86                 COMPONENT ${_ELEM_COMPONENT})
88 ENDFOREACH()
91 ################
92 # bin
93 ################
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)
123   ENDIF()
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
130                             GROUP_READ
131                             WORLD_READ
132                 COMPONENT ${_ELEM_COMPONENT})
134 ENDFOREACH()
137 ################
138 # share 
139 ################
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)
157     ENDIF()
159     IF(${_INST_PATH} MATCHES /share/doc)
160       SET(_ELEM_COMPONENT runtime_release)
161     ENDIF()
163     IF(${_INST_PATH} MATCHES /Doc)
164       SET(_ELEM_COMPONENT doc)
165     ENDIF()
167     IF(${_INST_PATH} MATCHES /Doc$)
168       SET(BASE_DOC_DIR ${_INST_PATH})
169     ENDIF()
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)
182       ELSE()
183         SET(_ELEM_COMPONENT example_projects)
184       ENDIF()
185     ENDIF()
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
192                               GROUP_READ
193                               WORLD_READ
194                   COMPONENT ${_ELEM_COMPONENT})
195   ENDIF()
197 ENDFOREACH()
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})
204 IF(_OSG_FC_VERSION)
205   SET(OSG_HOST_SYSTEM_NAME ${_OSG_FC_VERSION})
206 ENDIF()
208 IF(WIN32)
209   SET(OSG_HOST_SYSTEM_NAME "win")
210 ENDIF()
212 IF(CMAKE_CL_64)
213   SET(OSG_HOST_SYSTEM_PROCESSOR x86_64)
214 ELSE()
215   SET(OSG_HOST_SYSTEM_PROCESSOR 32)
216 ENDIF()
218 SET(SYSTEM_SPEC ${OSG_HOST_SYSTEM_NAME}.${OSG_HOST_SYSTEM_PROCESSOR})
220 # Date macro by Benoit RAT (www.neub.co.nr)
221 MACRO (TODAY RESULT)
222   IF (WIN32)
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}}")
226   ELSEIF(UNIX)
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}}")
230   ELSE (WIN32)
231     MESSAGE(SEND_ERROR "date not implemented")
232     SET(${RESULT} 000000)
233   ENDIF (WIN32)
234 ENDMACRO (TODAY)
236 IF(OSG_BUILD_DATE)
237   SET(DATE ${OSG_BUILD_DATE})
238 ELSE()
239   IF(${CMAKE_VERSION} VERSION_GREATER "3.0.0")
240     STRING(TIMESTAMP DATE "%d.%m.%Y")
241   ELSE()
242     TODAY(DATE)
243   ENDIF()
244 ENDIF()
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)
263 ENDIF()
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 "")
270   IF(WIN32)
271     SET(OSGBUILD_PACKAGE_TYPE "ZIP")
272   ELSE(WIN32)
273     SET(OSGBUILD_PACKAGE_TYPE "TBZ2")
274   ENDIF(WIN32)
275 ENDIF()
277 STRING(TOUPPER ${OSGBUILD_PACKAGE_TYPE} CPACK_GENERATOR)
279 SET(CPACK_COMPONENTS_ALL libraries_release
280                          libraries_releasenoopt
281                          libraries_debug
282                          libraries_debugopt
284                          python_release
285                          python_releasenoopt
286                          python_debug
287                          python_debugopt
289                          runtime_release
290                          runtime_releasenoopt
291                          runtime_debug
292                          runtime_debugopt
294                          app_release
295                          app_releasenoopt
296                          app_debugopt
297                          app_debug
299                          headers
300                          development_tools
301                          development_config
303                          examples_release
304                          examples_releasenoopt
305                          examples_debugopt
306                          examples_debug
307                          
308                          app_data
309                          example_projects)
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.")
315 ###########
316 # Libraries
317 ###########
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)
339 ##################
340 # Libraries python
341 ##################
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)
363 ###########
364 # Runtime
365 ###########
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)
387 ###########
388 # App
389 ###########
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)
416 ###########
417 # Dev
418 ###########
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)
440 ###########
441 # Examples
442 ###########
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
466 IF(WIN32)
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@")
476 #      ENDIF()
477 #    ENDIF()
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")
505     ELSE()
506       SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES32")
507     ENDIF()
509   ENDIF()
510 ENDIF()
512 MESSAGE("FOOO ${CPACK_PACKAGE_FILE_NAME}")
514 INCLUDE(CPack)