forked from percolator/percolator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CPack.txt
134 lines (123 loc) · 6.47 KB
/
CPack.txt
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
###############################################################################
# PACKAGING
###############################################################################
# PACKAGING OPTIONS: GENERAL
set(CPACK_SET_DESTDIR TRUE) # Enabling absolute paths for CPack (important!)
set(CPACK_SOURCE_GENERATOR "TGZ") # This file format is used to package source code ("make package_source")
set(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_CURRENT_BINARY_DIR};${CMAKE_PROJECT_NAME};ALL;/")
set(CPACK_PACKAGE_VENDOR "Percolator")
set(CPACK_PACKAGE_NAME ${PACKAGE_NICKNAME})
file(COPY ${PERCOLATOR_SOURCE_DIR}/ReadMe.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
file(COPY ${PERCOLATOR_SOURCE_DIR}/license.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_BINARY_DIR}/ReadMe.txt")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/license.txt")
set(PERLUQVAL_VERSION "v${CPACK_PACKAGE_VERSION_MAJOR}-${CPACK_PACKAGE_VERSION_MINOR}")
IF(APPLE)
set(CPACK_GENERATOR productbuild)
set(CPACK_COMPONENTS_ALL Unspecified)
# set(CPACK_GENERATOR PackageMaker)
set(CMAKE_INSTALL_PREFIX /usr/local)
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NICKNAME}-${PERLUQVAL_VERSION}-osx-${TARGET_ARCH}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE_NICKNAME}-${PERLUQVAL_VERSION}-osx-src")
set(CMAKE_OSX_ARCHITECTURES ${TARGET_ARCH} CACHE STRING "Build architectures for OSX" FORCE)
set(CPACK_PACKAGE_ICON "${PERCOLATOR_SOURCE_DIR}/admin/win/nsi/percolator.ico")
set(CPACK_BUNDLE_NAME ${PACKAGE_NICKNAME})
# set(CPACK_RESOURCE_FILE_README "${PACKAGE_BINARY_DIR}/Readme.txt")
# set(CPACK_RESOURCE_FILE_LICENSE "${PACKAGE_BINARY_DIR}/EULA.txt")
# set(CPACK_RESOURCE_FILE_WELCOME "${PACKAGE_BINARY_DIR}/Welcome.txt")
# set(CPACK_BUNDLE_STARTUP_COMMAND "${PERCOLATOR_SOURCE_DIR}/mac_post_script.sh")
elseif(UNIX)
# set(CPACK_GENERATOR "DEB;RPM") # Distribution packaging formats ("make package") might be overrided later
set(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NICKNAME}-${PERLUQVAL_VERSION}-linux-${TARGET_ARCH}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE_NICKNAME}-${PERLUQVAL_VERSION}-linux-src")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PACKAGE_NICKNAME}-${PERLUQVAL_VERSION}")
elseif(MINGW)
set(CPACK_SET_DESTDIR FALSE)
set(CPACK_GENERATOR "NSIS") # Distribution packaging formats ("make package")
set(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NICKNAME}-${PERLUQVAL_VERSION}-${MINGW_PACK_NAME}")
set(CPACK_NSIS_PACKAGE_NAME "${PACKAGE_NICKNAME}-${PERLUQVAL_VERSION}")
set(CPACK_NSIS_MODIFY_PATH "ON")
set(CPACK_PACKAGE_ICON "${PERCOLATOR_SOURCE_DIR}/admin/win/nsi/page_header.bmp")
set(CPACK_NSIS_MUI_ICON "${PERCOLATOR_SOURCE_DIR}/admin/win/nsi/percolator.ico")
set(CPACK_NSIS_CONTACT "Lukas Kall <[email protected]>")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PACKAGE_NICKNAME}-${PERLUQVAL_VERSION}")
elseif(MSVC)
set(CPACK_SET_DESTDIR FALSE)
set(CPACK_GENERATOR "NSIS") # Distribution packaging formats ("make package")
set(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NICKNAME}-${PERLUQVAL_VERSION}")
set(CPACK_NSIS_PACKAGE_NAME "${PACKAGE_NICKNAME}-${PERLUQVAL_VERSION}")
set(CPACK_NSIS_MODIFY_PATH "ON")
set(CPACK_PACKAGE_ICON "${PERCOLATOR_SOURCE_DIR}/admin/win/nsi\\\\page_header.bmp")
set(CPACK_NSIS_MUI_ICON "${PERCOLATOR_SOURCE_DIR}/admin/win/nsi\\\\percolator.ico")
set(CPACK_NSIS_CONTACT "Lukas Kall <[email protected]>")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PACKAGE_NICKNAME}-${PERLUQVAL_VERSION}")
endif()
if(UNIX)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(SPECIFIC_SYSTEM_VERSION_NAME "${CMAKE_SYSTEM_NAME}")
set(CPACK_GENERATOR "TGZ")
if(EXISTS "/etc/redhat-release")
set(LINUX_NAME "")
file(READ "/etc/redhat-release" LINUX_ISSUE)
elseif(EXISTS "/etc/issue")
set(LINUX_NAME "")
file(READ "/etc/issue" LINUX_ISSUE)
endif()
if(DEFINED LINUX_ISSUE)
# Fedora case
if(LINUX_ISSUE MATCHES "Fedora")
string(REGEX MATCH "release ([0-9]+)" FEDORA "${LINUX_ISSUE}")
set(LINUX_NAME "FC${CMAKE_MATCH_1}")
set(CPACK_GENERATOR "RPM")
endif(LINUX_ISSUE MATCHES "Fedora")
# Red Hat case
if(LINUX_ISSUE MATCHES "Red")
string(REGEX MATCH "release ([0-9]+\\.[0-9]+)" REDHAT "${LINUX_ISSUE}")
set(LINUX_NAME "RHEL_${CMAKE_MATCH_1}")
set(CPACK_GENERATOR "RPM")
endif(LINUX_ISSUE MATCHES "Red")
# CentOS case
if(LINUX_ISSUE MATCHES "CentOS")
string(REGEX MATCH "release ([0-9]+\\.[0-9]+)" CENTOS "${LINUX_ISSUE}")
set(LINUX_NAME "CentOS_${CMAKE_MATCH_1}")
set(CPACK_GENERATOR "RPM")
endif(LINUX_ISSUE MATCHES "CentOS")
# Ubuntu case
if(LINUX_ISSUE MATCHES "Ubuntu")
string(REGEX MATCH "buntu ([0-9]+\\.[0-9]+)" UBUNTU "${LINUX_ISSUE}")
set(LINUX_NAME "Ubuntu_${CMAKE_MATCH_1}")
set(CPACK_GENERATOR "DEB")
endif(LINUX_ISSUE MATCHES "Ubuntu")
# Debian case
if(LINUX_ISSUE MATCHES "Debian")
string(REGEX MATCH "Debian .*ux ([a-zA-Z]*/?[a-zA-Z]*) .*" DEBIAN "${LINUX_ISSUE}")
set(LINUX_NAME "Debian_${CMAKE_MATCH_1}")
string(REPLACE "/" "_" LINUX_NAME ${LINUX_NAME})
set(CPACK_GENERATOR "DEB")
endif(LINUX_ISSUE MATCHES "Debian")
# Open SuSE case
if(LINUX_ISSUE MATCHES "SUSE")
string(REGEX MATCH "SUSE ([0-9]+\\.[0-9]+)" SUSE "${LINUX_ISSUE}")
set(LINUX_NAME "openSUSE_${CMAKE_MATCH_1}")
string(REPLACE "/" "_" LINUX_NAME ${LINUX_NAME})
set(CPACK_GENERATOR "RPM")
endif(LINUX_ISSUE MATCHES "SUSE")
endif(DEFINED LINUX_ISSUE)
endif(CMAKE_SYSTEM_NAME MATCHES "Linux")
endif(UNIX)
set(CPACK_STRIP_FILES TRUE)
file(GLOB_RECURSE DOT_FILES_BEGIN ".*") # To be ignored by Cpack
file(GLOB_RECURSE TILD_FILES "*~*") # To be ignored by Cpack
set(CPACK_SOURCE_IGNORE_FILES "/CVS/;/.svn/;/.swp$/;cscope.*;/.git/;${CMAKE_CURRENT_BINARY_DIR}/;/.bzr/;/.settings/;${DOT_FILES_BEGIN};${TILD_FILES}")
if( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS )
install( PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION bin COMPONENT System )
endif( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS )
# PACKAGING OPTIONS: DEB
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Lukas Kall <[email protected]>")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${TARGET_ARCH})
# PACKAGING OPTIONS: RPM
set(CPACK_RPM_PACKAGE_LICENSE "Apache 2.0 license")
set(CPACK_RPM_PACKAGE_VENDOR "Percolator")
set(CPACK_RPM_PACKAGE_GROUP "Applications/Engineering")
set(CPACK_RPM_PACKAGE_RELOCATABLE FALSE)