add option to disable installing g3log for project embedding (#333)

This commit is contained in:
bmagistro 2020-02-14 17:24:48 -05:00 committed by GitHub
parent 3a905ed83d
commit 3ffc36a3a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 24 deletions

View File

@ -31,34 +31,37 @@ 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
EXPORT g3logger-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}
)
IF(INSTALL_G3LOG)
INSTALL( TARGETS g3logger
EXPORT g3logger-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( FILES ${HEADER_FILES}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/g3log
COMPONENT headers)
INSTALL(
EXPORT g3logger-targets
FILE g3loggerTargets.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/g3logger
)
INSTALL(
EXPORT g3logger-targets
FILE g3loggerTargets.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/g3logger
)
CONFIGURE_PACKAGE_CONFIG_FILE(
${PROJECT_SOURCE_DIR}/cmake/g3loggerConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/g3loggerConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/g3logger
)
CONFIGURE_PACKAGE_CONFIG_FILE(
${PROJECT_SOURCE_DIR}/cmake/g3loggerConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/g3loggerConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/g3logger
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/g3loggerConfig.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/g3logger
)
ENDIF()
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/g3loggerConfig.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/g3logger
)
SET(CPACK_COMPONENTS_ALL libraries headers)
SET(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "G3Log libraries")

View File

@ -147,6 +147,7 @@ IF (MSVC OR MINGW)
ENDIF (MSVC OR MINGW)
message( STATUS "\n\n\n" )
option(INSTALL_G3LOG "Enable installation of g3logger. (Projects embedding g3logger may want to turn this OFF.)" ON)