mirror of
https://github.com/KjellKod/g3log.git
synced 2024-12-12 10:23:50 +01:00
217f52fb12
* CMake: CMAKE_INSTALL_PREFIX for Linux If on Linux system CMAKE_INSTALL_PREFIX is set it overrides CPACK_PACKAGING_INSTALL_PREFIX key. * Readme: readme for MinGW building and installation * Update README.markdown
106 lines
4.0 KiB
Plaintext
106 lines
4.0 KiB
Plaintext
# ==========================================================================
|
|
# 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
|
|
# ============================================================================*/
|
|
|
|
# INSTALL( TARGETS g3logger_shared
|
|
# ARCHIVE
|
|
# LIBRARY DESTINATION lib/g3log
|
|
# COMPONENT libraries)
|
|
|
|
# INSTALL( FILES ${HEADER_FILES}
|
|
# DESTINATION include
|
|
# COMPONENT headers)
|
|
|
|
IF(NOT MINGW)
|
|
IF(NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
|
SET(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
|
ELSEIF(NOT CPACK_PACKAGING_INSTALL_PREFIX)
|
|
SET(CPACK_PACKAGING_INSTALL_PREFIX /usr/local)
|
|
ENDIF()
|
|
ENDIF()
|
|
|
|
SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output dir for libraries")
|
|
SET(CMAKE_INSTALL_HEADERDIR include CACHE PATH "Output dir for headers")
|
|
|
|
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")
|
|
SET(CMAKE_INSTALL_HEADERDIR ${CMAKE_INSTALL_HEADERDIR}/g3log)
|
|
|
|
IF(NOT MINGW)
|
|
INSTALL( TARGETS g3logger
|
|
ARCHIVE DESTINATION ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
|
|
LIBRARY DESTINATION ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
|
|
COMPONENT libraries)
|
|
|
|
INSTALL( FILES ${HEADER_FILES}
|
|
DESTINATION ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_HEADERDIR}
|
|
COMPONENT headers)
|
|
|
|
INSTALL( FILES ${PROJECT_SOURCE_DIR}/cmake/g3loggerConfig.cmake
|
|
DESTINATION ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/cmake/g3logger)
|
|
ELSE()
|
|
INSTALL( TARGETS g3logger
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
COMPONENT libraries)
|
|
|
|
INSTALL( FILES ${HEADER_FILES}
|
|
DESTINATION ${CMAKE_INSTALL_HEADERDIR}
|
|
COMPONENT headers)
|
|
|
|
INSTALL( FILES ${PROJECT_SOURCE_DIR}/cmake/g3loggerConfig.cmake
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/g3logger)
|
|
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")
|
|
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_HEADERDIR}" )
|
|
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
|
|
# CMAKE_INSTALL_HEADERDIR
|
|
# CMAKE_INSTALL_LIBDIR
|
|
|
|
|
|
INCLUDE(CPack)
|
|
|
|
|