mirror of
https://github.com/KjellKod/g3log.git
synced 2024-12-12 10:23:50 +01:00
Add CMake package support
Signed-off-by: Ricky Zhang <rickyzhang@gmail.com>
This commit is contained in:
parent
6bf8afddfa
commit
601f6af1fd
@ -112,7 +112,7 @@ endif()
|
||||
|
||||
|
||||
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
# ==========================================================================
|
||||
# BETA : package manager for G3Log,. not yet reliable. Use at your own risk
|
||||
# only tested on Ubuntu and CentOS
|
||||
|
@ -30,6 +30,8 @@
|
||||
DESTINATION ${CMAKE_INSTALL_HEADERDIR}/g3log
|
||||
COMPONENT headers)
|
||||
|
||||
INSTALL( FILES ${PROJECT_SOURCE_DIR}/cmake/G3LOGConfig.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/G3LOG)
|
||||
|
||||
SET(CPACK_COMPONENTS_ALL libraries headers)
|
||||
SET(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "G3Log libraries")
|
||||
|
27
cmake/G3LOGConfig.cmake
Normal file
27
cmake/G3LOGConfig.cmake
Normal file
@ -0,0 +1,27 @@
|
||||
#.rst:
|
||||
# FindG3log
|
||||
# -------
|
||||
#
|
||||
# Find libg3logger, G3log is an asynchronous, "crash safe", logger that is easy to use with default logging sinks or you can add your own.
|
||||
#
|
||||
# Result variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# This module will set the following variables in your project:
|
||||
#
|
||||
# ``G3LOG_INCLUDE_DIRS``
|
||||
# where to find g3log.hpp, etc.
|
||||
# ``G3LOG_LIBRARIES``
|
||||
# the libraries to link against to use libg3logger.
|
||||
# that includes libg3logger library files.
|
||||
# ``G3LOG_FOUND``
|
||||
# If false, do not try to use G3LOG.
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_path(G3LOG_INCLUDE_DIR g3log/g3log.hpp)
|
||||
find_library(G3LOG_LIBRARY
|
||||
NAMES libg3logger g3logger)
|
||||
find_package_handle_standard_args(G3LOG DEFAULT_MSG
|
||||
G3LOG_INCLUDE_DIR G3LOG_LIBRARY)
|
||||
mark_as_advanced(G3LOG_INCLUDE_DIR G3LOG_LIBRARY)
|
||||
set(G3LOG_LIBRARIES ${G3LOG_LIBRARY})
|
||||
set(G3LOG_INCLUDE_DIRS ${G3LOG_INCLUDE_DIR})
|
Loading…
Reference in New Issue
Block a user