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
|
|
|
|
# ============================================================================*/
|
|
|
|
|
2014-10-10 06:04:26 +02:00
|
|
|
# INSTALL( TARGETS g3logger_shared
|
|
|
|
# ARCHIVE
|
|
|
|
# LIBRARY DESTINATION lib/g3log
|
|
|
|
# COMPONENT libraries)
|
|
|
|
|
|
|
|
# INSTALL( FILES ${HEADER_FILES}
|
|
|
|
# DESTINATION include
|
|
|
|
# COMPONENT headers)
|
|
|
|
|
2017-03-26 09:11:18 +02:00
|
|
|
SET(MAJOR_VERSION 1)
|
|
|
|
IF (NOT DEFINED ${VERSION})
|
|
|
|
MESSAGE("Extracting git software version")
|
|
|
|
execute_process(COMMAND bash "-c" "git rev-list --branches HEAD | wc -l | tr -d ' ' | tr -d '\n'" OUTPUT_VARIABLE GIT_VERSION)
|
2017-03-30 09:48:35 +02:00
|
|
|
SET(MINOR_VERSION 3)
|
2017-03-29 19:25:23 +02:00
|
|
|
SET(BUILD_NUMBER ${GIT_VERSION})
|
2017-03-26 09:11:18 +02:00
|
|
|
SET(VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${BUILD_NUMBER})
|
|
|
|
ENDIF()
|
|
|
|
MESSAGE("Software Version: ${VERSION}")
|
|
|
|
|
|
|
|
SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output dir for libraries")
|
|
|
|
SET(CMAKE_INSTALL_HEADERDIR include CACHE PATH "Output dir for headers")
|
|
|
|
|
|
|
|
IF (NOT DEFINED ${CPACK_INSTALL_PREFIX})
|
|
|
|
SET(CPACK_INSTALL_PREFIX "/usr/local")
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
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 hedstrom@kjellkoc.cc")
|
|
|
|
SET(CPACK_RESOURCE_FILE_LICENSE ${g3log_SOURCE_DIR}/LICENSE)
|
|
|
|
SET(CPACK_PACKAGE_VENDOR "KjellKod")
|
|
|
|
|
|
|
|
|
|
|
|
INSTALL( TARGETS g3logger g3logger_shared
|
2016-01-24 13:27:52 +01:00
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
2014-10-03 09:04:26 +02:00
|
|
|
COMPONENT libraries)
|
|
|
|
|
2017-03-26 09:11:18 +02:00
|
|
|
INSTALL( FILES ${HEADER_FILES}
|
2016-01-24 13:27:52 +01:00
|
|
|
DESTINATION ${CMAKE_INSTALL_HEADERDIR}/g3log
|
2014-10-03 09:04:26 +02:00
|
|
|
COMPONENT headers)
|
2016-01-24 13:27:52 +01:00
|
|
|
|
2017-03-26 09:11:18 +02:00
|
|
|
INSTALL( FILES ${PROJECT_SOURCE_DIR}/cmake/G3LOGConfig.cmake
|
2016-12-22 17:30:18 +01:00
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/G3LOG)
|
2014-10-03 09:04:26 +02:00
|
|
|
|
2017-03-26 09:11:18 +02:00
|
|
|
SET(CPACK_COMPONENTS_ALL libraries headers)
|
|
|
|
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")
|
|
|
|
MESSAGE("\nTo create installation package: ")
|
|
|
|
MESSAGE("make package")
|
|
|
|
ENDIF()
|
2014-10-10 06:04:26 +02:00
|
|
|
|
|
|
|
|
2017-03-26 09:11:18 +02:00
|
|
|
MESSAGE("\nOption to install using 'sudo make install")
|
|
|
|
MESSAGE("Installation locations: ")
|
|
|
|
MESSAGE("====================")
|
|
|
|
MESSAGE("Headers: ${CPACK_INSTALL_PREFIX}/${CMAKE_INSTALL_HEADERDIR}/g3log")
|
|
|
|
MESSAGE("Library installation directory: ${CPACK_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
|
2014-10-10 06:04:26 +02:00
|
|
|
|
2017-03-26 09:11:18 +02:00
|
|
|
MESSAGE("For more information please see g3log/CPackLists.txt\n\n")
|
|
|
|
MESSAGE("To install: sudo dpkg -i g3log-***Linux.deb")
|
|
|
|
MESSAGE("To list package contents: sudo dpkg --contents g3log-***Linux.deb")
|
2014-10-10 06:04:26 +02:00
|
|
|
|
2017-03-26 09:11:18 +02:00
|
|
|
MESSAGE("List content of the installed package: sudo dpkg -L g3log")
|
|
|
|
MESSAGE("To remove: sudo dpkg -r g3log")
|
2016-03-07 07:02:04 +01:00
|
|
|
|
|
|
|
# NOTE: to change installation locations you can use the settings below
|
|
|
|
# examples:
|
|
|
|
# CPACK_INSTALL_PREFIX
|
|
|
|
# CPACK_PACKAGE_INSTALL_DIRECTORY
|
|
|
|
# CMAKE_INSTALL_HEADERDIR
|
|
|
|
# CMAKE_INSTALL_LIBDIR
|
2014-10-10 06:04:26 +02:00
|
|
|
|
|
|
|
|
2016-03-07 07:02:04 +01:00
|
|
|
INCLUDE(CPack)
|
2014-10-10 06:04:26 +02:00
|
|
|
|