forked from GuLinux/PlanetaryImager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
packaging.cmake
44 lines (30 loc) · 1.78 KB
/
packaging.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
set(PACKAGE_VERSION_SUFFIX "" CACHE STRING "Suffix package version (default: empty)")
set(PACKAGE_NAME_SUFFIX "" CACHE STRING "Suffix package name (default: empty)")
set(PACKAGE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME} CACHE STRING "System name for generated packages (default: ${CMAKE_SYSTEM_NAME}")
INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GuLinux.net Planetary Imager for Linux")
SET(CPACK_PACKAGE_VENDOR "GuLinux <marco@gulinux.net>")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/src/")
SET(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
set(CPACK_PACKAGE_FILE_NAME PlanetaryImager-${FULL_VERSION}-${PACKAGE_SYSTEM_NAME}-${PlanetaryImager_ARCH}${PACKAGE_NAME_SUFFIX})
SET(CPACK_PACKAGE_CONTACT "marco@gulinux.net")
#SET(CPACK_STRIP_FILES "bin/planetary_imager")
set(CPACK_SET_DESTDIR On)
SET(CPACK_GENERATOR TGZ CACHE STRING "CPack generator type (default: TGZ)")
if( CPACK_GENERATOR STREQUAL "NSIS")
set(CPACK_SET_DESTDIR Off)
endif()
message(STATUS "Packaging PlanetaryImager with CPACK_GENERATOR=${CPACK_GENERATOR}")
string(TOLOWER ${CPACK_GENERATOR} CPACK_FILE_EXTENSION)
if("${CPACK_GENERATOR}" STREQUAL TGZ)
set(CPACK_FILE_EXTENSION "tar.gz")
elseif("${CPACK_GENERATOR}" STREQUAL TBZ2)
set(CPACK_FILE_EXTENSION "tar.bz2")
endif()
set(CPACK_PACKAGE_FULL_FILENAME ${CPACK_PACKAGE_FILE_NAME}.${CPACK_FILE_EXTENSION})
message(STATUS "Will generate the following package: ${CPACK_PACKAGE_FULL_FILENAME}")
file(WRITE ${CMAKE_BINARY_DIR}/package_name.cfg "CPACK_PACKAGE_FILENAME=${CPACK_PACKAGE_FULL_FILENAME}\nCPACK_PACKAGE_DIRECTORY=${CPACK_PACKAGE_DIRECTORY}\n")
INCLUDE(CPack)