This repository has been archived by the owner on Jun 23, 2023. It is now read-only.
forked from KjellKod/g3log
-
Notifications
You must be signed in to change notification settings - Fork 6
/
CPackLists.txt
104 lines (86 loc) · 3.86 KB
/
CPackLists.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
# ==========================================================================
# 2015 by KjellKod.cc. This is PUBLIC DOMAIN to use at your own risk and comes
# with no warranties. This code is yours to share, use and modify with no
# strings attached and no restrictions or obligations.
#
# For more information see g3log/LICENSE or refer refer to http://unlicense.org
# ============================================================================*/
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
IF(NOT CPACK_PACKAGING_INSTALL_PREFIX)
IF(NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
# set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX})
ELSE()
SET(CPACK_PACKAGING_INSTALL_PREFIX /usr/local)
ENDIF()
ENDIF()
# message("Install rpath location: ${CMAKE_INSTALL_RPATH}")
ENDIF()
INCLUDE(CMakePackageConfigHelpers)
INCLUDE(GNUInstallDirs)
SET(CPACK_PACKAGE_NAME g3log)
SET(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR_VERSION})
SET(CPACK_PACKAGE_VERSION_MINOR ${MINOR_VERSION})
SET(CPACK_PACKAGE_VERSION_PATCH ${BUILD_NUMBER})
SET(CPACK_PACKAGE_DESCRIPTION "Asynchronous 'crash safe' logger
License: http://unlicense.org
Repository: https://github.com/KjellKod/g3log")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${CPACK_PACKAGE_DESCRIPTION})
SET(CPACK_PACKAGE_CONTACT "Kjell Hedstrom [email protected]")
SET(CPACK_RESOURCE_FILE_LICENSE ${g3log_SOURCE_DIR}/LICENSE)
SET(CPACK_PACKAGE_VENDOR "KjellKod")
IF(INSTALL_G3LOG)
INSTALL( TARGETS g3log
EXPORT g3log-targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
INSTALL( FILES ${HEADER_FILES}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/g3log
COMPONENT headers)
INSTALL(
EXPORT g3log-targets
FILE g3logTargets.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/g3log
)
CONFIGURE_PACKAGE_CONFIG_FILE(
${PROJECT_SOURCE_DIR}/cmake/g3logConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/g3logConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/g3log
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/g3logConfig.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/g3log
)
ENDIF()
SET(CPACK_COMPONENTS_ALL libraries headers)
SET(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "g3log libraries")
SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "g3log C++ headers")
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "KjellKod - Kjell Hedstrom")
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
SET(CPACK_GENERATOR "ZIP") # Otherwise, NSIS is needed.
ENDIF()
message( STATUS "\nTo create installation package: " )
message( STATUS "make package" )
message( STATUS "\nOption to install using 'make install'" )
message( STATUS "Installation locations: " )
message( STATUS "====================" )
message( STATUS "Headers: ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/g3log" )
message( STATUS "Library installation directory: ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" )
message( STATUS "For more information please see g3log/CPackLists.txt\n\n" )
IF(NOT MINGW)
message( STATUS "To install: sudo dpkg -i g3log-***Linux.deb" )
message( STATUS "To list package contents: sudo dpkg --contents g3log-***Linux.deb" )
message( STATUS "List content of the installed package: sudo dpkg -L g3log" )
message( STATUS "To remove: sudo dpkg -r g3log" )
ENDIF()
# NOTE: to change installation locations you can use the settings below
# examples:
# CPACK_PACKAGING_INSTALL_PREFIX
# CPACK_OUTPUT_FILE_PREFIX
# CMAKE_INSTALL_PREFIX
INCLUDE(CPack)