2 # First, set the generator variable
4 if(NOT CPACK_GENERATOR)
6 find_program(NSIS_MAKENSIS NAMES makensis
7 PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS]
8 DOC
"Where is makensis.exe located"
12 set(CPACK_GENERATOR ZIP)
14 set(CPACK_GENERATOR
"NSIS;ZIP")
16 endif(NOT NSIS_MAKENSIS)
19 set(CPACK_GENERATOR DragNDrop)
21 set(CPACK_GENERATOR TGZ)
24 endif(NOT CPACK_GENERATOR)
26 # Set Redistributable information for windows
27 if(${CMAKE_SYSTEM_NAME} MATCHES Windows)
30 set(CPACK_VISUAL_STUDIO_VERSION_MAJOR "${VISUAL_STUDIO_VERSION_MAJOR}
")
31 set(CPACK_VISUAL_STUDIO_PRODUCT_NAME "${VISUAL_STUDIO_PRODUCT_NAME}
")
32 set(CPACK_LIBRARY_ARCHITECTURE "${CMAKE_LIBRARY_ARCHITECTURE}
")
33 set(CMAKE_${CPACK_VISUAL_STUDIO_PRODUCT_NAME}_REDISTRIBUTABLE "" CACHE FILEPATH "Path to the appropriate Microsoft Visual Studio Redistributable
")
36 if(EXISTS ${CMAKE_${CPACK_VISUAL_STUDIO_PRODUCT_NAME}_REDISTRIBUTABLE} )
37 install(PROGRAMS ${CMAKE_${CPACK_VISUAL_STUDIO_PRODUCT_NAME}_REDISTRIBUTABLE}
38 DESTINATION thirdpartyinstallers)
41 # On windows set default install directory appropriately for 32 and 64 bit
42 # installers if not already set
43 if(WIN32 AND NOT CPACK_NSIS_INSTALL_ROOT)
45 set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64
")
47 set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES
")
51 # By default, do not warn when built on machines using only VS Express
52 if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
53 set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
56 # include required mfc libraries
57 include(InstallRequiredSystemLibraries)
59 set(CPACK_PACKAGE_NAME "MITK
")
60 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MITK is a medical image processing tool
")
61 set(CPACK_PACKAGE_VENDOR "German Cancer Research Center (DKFZ)
")
62 set(CPACK_PACKAGE_DESCRIPTION_FILE "${MITK_SOURCE_DIR}/LICENSE.txt
")
63 set(CPACK_RESOURCE_FILE_LICENSE "${MITK_SOURCE_DIR}/LICENSE.txt
")
67 # tell cpack to strip all debug symbols from all files
68 set(CPACK_STRIP_FILES ON)
70 # append revision number if available
71 if(MITK_REVISION_ID AND MITK_VERSION_PATCH STREQUAL "99
")
72 if(MITK_WC_TYPE STREQUAL "git
")
73 set(git_hash ${MITK_REVISION_ID})
74 string(LENGTH "${git_hash}
" hash_length)
75 if(hash_length GREATER 6)
76 string(SUBSTRING ${git_hash} 0 6 git_hash)
87 set(CPACK_PACKAGE_VERSION
88 "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
")
90 # determine possible system specific extension
91 set(CPACK_PACKAGE_ARCH "unkown-architecture
")
93 if(${CMAKE_SYSTEM_NAME} MATCHES Windows)
95 set(CPACK_PACKAGE_ARCH "win64
")
97 set(CPACK_PACKAGE_ARCH "mingw32
")
99 set(CPACK_PACKAGE_ARCH "win32
")
101 endif(${CMAKE_SYSTEM_NAME} MATCHES Windows)
103 if(${CMAKE_SYSTEM_NAME} MATCHES Linux)
104 if(${CMAKE_SYSTEM_PROCESSOR} MATCHES i686)
105 set(CPACK_PACKAGE_ARCH "linux32
")
106 elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES x86_64)
107 if(${CMAKE_CXX_FLAGS} MATCHES " -m32
")
108 set(CPACK_PACKAGE_ARCH "linux32
")
110 set(CPACK_PACKAGE_ARCH "linux64
")
111 endif(${CMAKE_CXX_FLAGS} MATCHES " -m32
")
113 set(CPACK_PACKAGE_ARCH "linux
")
115 endif(${CMAKE_SYSTEM_NAME} MATCHES Linux)
117 if(${CMAKE_SYSTEM_NAME} MATCHES Darwin)
118 set(CPACK_PACKAGE_ARCH "mac64
")
119 endif(${CMAKE_SYSTEM_NAME} MATCHES Darwin)
121 set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_ARCH}
")
#define MITK_VERSION_MAJOR
#define MITK_VERSION_PATCH
#define MITK_VERSION_MINOR
mitkFunctionGetMSVCVersion()
Get diverse visual studio ids not directly provided by CMake.