-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommons.cmake.in
71 lines (69 loc) · 3.04 KB
/
commons.cmake.in
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
##############################################################################
# CPACK Configuration base
# This configuration file should be included
cmake_policy(SET CMP0011 NEW)
cmake_policy(SET CMP0012 NEW)
set(CPACK_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
set(CPACK_INSTALL_CMAKE_PROJECTS "@PROJECT_BINARY_DIR@;@PROJECT_NAME@;ALL;/")
set(CPACK_BUILD_SOURCE_DIRS "@CMAKE_SOURCE_DIR@;@CMAKE_BINARY_DIR@")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "@PROJECT_DESCRIPTION@")
set(CPACK_PACKAGE_DESCRIPTION_FILE "@CPACK_PACKAGE_DESCRIPTION_FILE@")
set(CPACK_COMPONENTS_ALL "@PACKAGE_COMPONENTS_ALL@")
set(CPACK_PACKAGE_RELOCATABLE ON)
set(CPACK_PACKAGE_VERSION_MAJOR "@PROJECT_VERSION_MAJOR@")
set(CPACK_PACKAGE_VERSION_MINOR "@PROJECT_VERSION_MINOR@")
set(CPACK_PACKAGE_VERSION_PATCH "@PROJECT_VERSION_PATCH@")
set(CPACK_PACKAGE_VERSION "@PROJECT_VERSION@")
set(CPACK_RESOURCE_FILE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@")
set(CPACK_RESOURCE_FILE_README "@CPACK_RESOURCE_FILE_README@")
set(CPACK_PACKAGE_CONTACT "@CPACK_PACKAGE_CONTACT@")
set(CPACK_PACKAGE_VENDOR "@CPACK_PACKAGE_VENDOR@")
set(CPACK_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
set(OPTION_PKG_MULTIVERS @OPTION_PKG_MULTIVERS@)
set(PROJECT_URL "@PROJECT_URL@")
set(PKG_GROUP "@PKG_GROUP@")
##############################################################################
# CPACK base settings
#
# config_package ([DATA packaging-data-directory] [LOWCASE] [NAME package-name])
#
# DATA
# packaging data directory, default ${PROJECT_SOURCE_DIR}/packaging
#
# LOWCASE
# when passed CPACK_PACKAGE_NAME will be translated in lower case
#
# NAME
# value for CPACK_PACKAGE_NAME, default is "%PROJECT_NAME%".
# The string "%PROJECT_NAME%" is a placeholder for PROJECT_NAME variable,
# eligible to be changed to ${PROJECT_NAME}${PROJECT_VERSION_MAJOR}
# when OPTION_PKG_MULTIVERS is set.
#
# This macro manages all CPACK_* settings not OS specific. The only exceptions
# are CPACK_GENERATOR and CPACK_PACKAGE_FILE_NAME that must be defined
# elsewhere.
macro(config_package)
set(options LOWCASE)
set(oneValueArgs NAME DATA)
cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
if (NOT PKG_NAME)
set(PKG_NAME "%PROJECT_NAME%")
endif()
if (OPTION_PKG_MULTIVERS)
set(PKG_NAME "${PKG_NAME}@PROJECT_VERSION_MAJOR@")
endif()
string(REPLACE "%PROJECT_NAME%" "@PROJECT_NAME@" CPACK_PACKAGE_NAME "${PKG_NAME}")
if (PKG_LOWCASE)
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME)
endif()
if (NOT PKG_DATA)
set(PKG_DATA "@PROJECT_SOURCE_DIR@/packaging")
endif()
set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS "runtime")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PKG_DATA}/description-summary.txt")
if (@OPTION_PKG_DEBUGINFO@)
set(CPACK_STRIP_FILES OFF)
else()
set(CPACK_STRIP_FILES ON)
endif()
endmacro(config_package)