2015-07-16 09:55:23 +02:00
|
|
|
# ==========================================================================
|
|
|
|
# 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.
|
2016-01-24 13:27:52 +01:00
|
|
|
#
|
2015-07-16 09:55:23 +02:00
|
|
|
# For more information see g3log/LICENSE or refer refer to http://unlicense.org
|
|
|
|
# ============================================================================*/
|
|
|
|
|
2019-05-14 06:42:15 +02:00
|
|
|
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})
|
2020-07-09 06:42:55 +02:00
|
|
|
# set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX})
|
2019-05-14 06:42:15 +02:00
|
|
|
ELSE()
|
|
|
|
SET(CPACK_PACKAGING_INSTALL_PREFIX /usr/local)
|
|
|
|
ENDIF()
|
2017-12-27 21:09:40 +01:00
|
|
|
ENDIF()
|
2020-07-09 06:42:55 +02:00
|
|
|
# message("Install rpath location: ${CMAKE_INSTALL_RPATH}")
|
2017-12-27 21:09:40 +01:00
|
|
|
ENDIF()
|
2017-03-26 09:11:18 +02:00
|
|
|
|
2019-05-14 06:42:15 +02:00
|
|
|
INCLUDE(CMakePackageConfigHelpers)
|
|
|
|
INCLUDE(GNUInstallDirs)
|
2017-03-26 09:11:18 +02:00
|
|
|
|
|
|
|
SET(CPACK_PACKAGE_NAME g3log)
|
|
|
|
SET(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR_VERSION})
|
|
|
|
SET(CPACK_PACKAGE_VERSION_MINOR ${MINOR_VERSION})
|
2023-12-07 04:14:22 +01:00
|
|
|
SET(CPACK_PACKAGE_VERSION_PATCH ${GIT_RELEASE_COMMITS})
|
2017-03-26 09:11:18 +02:00
|
|
|
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 hedstrom@kjellkoc.cc")
|
|
|
|
SET(CPACK_RESOURCE_FILE_LICENSE ${g3log_SOURCE_DIR}/LICENSE)
|
|
|
|
SET(CPACK_PACKAGE_VENDOR "KjellKod")
|
|
|
|
|
2020-02-14 23:24:48 +01:00
|
|
|
IF(INSTALL_G3LOG)
|
2020-07-09 06:42:55 +02:00
|
|
|
INSTALL( TARGETS g3log
|
|
|
|
EXPORT g3log-targets
|
2020-02-14 23:24:48 +01:00
|
|
|
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}
|
|
|
|
)
|
2019-05-14 06:42:15 +02:00
|
|
|
|
2020-02-14 23:24:48 +01:00
|
|
|
INSTALL( FILES ${HEADER_FILES}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/g3log
|
|
|
|
COMPONENT headers)
|
2019-05-14 06:42:15 +02:00
|
|
|
|
2020-02-14 23:24:48 +01:00
|
|
|
INSTALL(
|
2020-07-09 06:42:55 +02:00
|
|
|
EXPORT g3log-targets
|
|
|
|
FILE g3logTargets.cmake
|
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/g3log
|
2020-02-14 23:24:48 +01:00
|
|
|
)
|
2019-05-14 06:42:15 +02:00
|
|
|
|
2020-02-14 23:24:48 +01:00
|
|
|
CONFIGURE_PACKAGE_CONFIG_FILE(
|
2020-07-09 06:42:55 +02:00
|
|
|
${PROJECT_SOURCE_DIR}/cmake/g3logConfig.cmake
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/g3logConfig.cmake
|
|
|
|
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/g3log
|
2020-02-14 23:24:48 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
install(
|
2020-07-09 06:42:55 +02:00
|
|
|
FILES ${CMAKE_CURRENT_BINARY_DIR}/g3logConfig.cmake
|
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/g3log
|
2020-02-14 23:24:48 +01:00
|
|
|
)
|
|
|
|
ENDIF()
|
2019-05-14 06:42:15 +02:00
|
|
|
|
2014-10-03 09:04:26 +02:00
|
|
|
|
2017-03-26 09:11:18 +02:00
|
|
|
SET(CPACK_COMPONENTS_ALL libraries headers)
|
2020-07-09 06:42:55 +02:00
|
|
|
SET(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "g3log libraries")
|
|
|
|
SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "g3log C++ headers")
|
2014-10-03 09:04:26 +02:00
|
|
|
|
2017-03-26 09:11:18 +02:00
|
|
|
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
SET(CPACK_GENERATOR "DEB")
|
|
|
|
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "KjellKod - Kjell Hedstrom")
|
2019-05-14 06:42:15 +02:00
|
|
|
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
|
|
|
SET(CPACK_GENERATOR "ZIP") # Otherwise, NSIS is needed.
|
2017-03-26 09:11:18 +02:00
|
|
|
ENDIF()
|
2014-10-10 06:04:26 +02:00
|
|
|
|
2017-12-27 21:09:40 +01:00
|
|
|
message( STATUS "\nTo create installation package: " )
|
|
|
|
message( STATUS "make package" )
|
2014-10-10 06:04:26 +02:00
|
|
|
|
2017-12-27 21:09:40 +01:00
|
|
|
message( STATUS "\nOption to install using 'make install'" )
|
2017-05-17 22:31:19 +02:00
|
|
|
message( STATUS "Installation locations: " )
|
|
|
|
message( STATUS "====================" )
|
2019-05-14 06:42:15 +02:00
|
|
|
message( STATUS "Headers: ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/g3log" )
|
2018-01-09 05:22:08 +01:00
|
|
|
message( STATUS "Library installation directory: ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" )
|
2014-10-10 06:04:26 +02:00
|
|
|
|
2017-05-17 22:31:19 +02:00
|
|
|
message( STATUS "For more information please see g3log/CPackLists.txt\n\n" )
|
2017-12-27 21:09:40 +01:00
|
|
|
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" )
|
2016-03-07 07:02:04 +01:00
|
|
|
|
2017-12-27 21:09:40 +01:00
|
|
|
message( STATUS "List content of the installed package: sudo dpkg -L g3log" )
|
|
|
|
message( STATUS "To remove: sudo dpkg -r g3log" )
|
|
|
|
ENDIF()
|
2016-03-07 07:02:04 +01:00
|
|
|
# NOTE: to change installation locations you can use the settings below
|
|
|
|
# examples:
|
2017-12-27 21:09:40 +01:00
|
|
|
# CPACK_PACKAGING_INSTALL_PREFIX
|
|
|
|
# CPACK_OUTPUT_FILE_PREFIX
|
|
|
|
# CMAKE_INSTALL_PREFIX
|
2014-10-10 06:04:26 +02:00
|
|
|
|
2017-12-27 21:09:40 +01:00
|
|
|
INCLUDE(CPack)
|
|
|
|
|
2014-10-10 06:04:26 +02:00
|
|
|
|