-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMIDASCPack.cmake
79 lines (74 loc) · 3.94 KB
/
MIDASCPack.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# Set the options file that needs to be included inside CMakeCPackOptions.cmake
#SET(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
CONFIGURE_FILE("${MIDASClient_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
"${MIDASClient_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
SET(CPACK_PROJECT_CONFIG_FILE "${MIDASClient_BINARY_DIR}/CMakeCPackOptions.cmake")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MIDAS Desktop Application")
SET(CPACK_PACKAGE_VENDOR "Kitware")
#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR "${MIDASClient_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${MIDASClient_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${MIDASClient_VERSION_PATCH}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "MIDASDesktop ${MIDASClient_VERSION_MAJOR}.${MIDASClient_VERSION_MINOR}")
SET(CPACK_PACKAGE_EXECUTABLES "MIDASDesktop" "MIDAS Desktop")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME
"midasdesktop-${MIDASClient_VERSION_MAJOR}.${MIDASClient_VERSION_MINOR}.${MIDASClient_VERSION_PATCH}")
IF(NOT DEFINED CPACK_SYSTEM_NAME)
# make sure package is not Cygwin-unknown, for Cygwin just
# cygwin is good for the system name
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
SET(CPACK_SYSTEM_NAME Cygwin)
ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
ENDIF(NOT DEFINED CPACK_SYSTEM_NAME)
IF(${CPACK_SYSTEM_NAME} MATCHES Windows)
IF(CMAKE_CL_64)
SET(CPACK_SYSTEM_NAME win64-${CMAKE_SYSTEM_PROCESSOR})
ELSE(CMAKE_CL_64)
SET(CPACK_SYSTEM_NAME win32-${CMAKE_SYSTEM_PROCESSOR})
ENDIF(CMAKE_CL_64)
ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows)
IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
# if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
# default to source package - system, on cygwin system is not
# needed
IF(CYGWIN)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
ELSE(CYGWIN)
SET(CPACK_PACKAGE_FILE_NAME
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
ENDIF(CYGWIN)
ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
#SET(CPACK_PACKAGE_CONTACT "cmake@cmake.org")
# cygwin specific packaging stuff
IF(CYGWIN)
# if we are on cygwin and have cpack, then force the
# doc, data and man dirs to conform to cygwin style directories
SET(MIDASClient_DOC_DIR "/share/doc/${CPACK_PACKAGE_FILE_NAME}")
SET(MIDASClient_DATA_DIR "/share/${CPACK_PACKAGE_FILE_NAME}")
SET(MIDASClient_MAN_DIR "/share/man")
# let the user know we just forced these values
MESSAGE(STATUS "Setup for Cygwin packaging")
MESSAGE(STATUS "Override cache MIDASClient_DOC_DIR = ${MIDASClient_DOC_DIR}")
MESSAGE(STATUS "Override cache MIDASClient_DATA_DIR = ${MIDASClient_DATA_DIR}")
MESSAGE(STATUS "Override cache MIDASClient_MAN_DIR = ${MIDASClient_MAN_DIR}")
# setup the cygwin package name
SET(CPACK_PACKAGE_NAME MIDASClient)
# setup the name of the package for cygwin cmake-2.4.3
SET(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${MIDASClient_VERSION_MAJOR}.${MIDASClient_VERSION_MINOR}.${MIDASClient_VERSION_PATCH}")
# the source has the same name as the binary
SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
# Create a cygwin version number in case there are changes for cygwin
# that are not reflected upstream in CMake
SET(CPACK_CYGWIN_PATCH_NUMBER 1)
# include the sub directory cmake file for cygwin that
# configures some files and adds some install targets
# this file uses some of the package file name variables
ENDIF(CYGWIN)
# include CPack model once all variables are set
INCLUDE(CPack)
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")