Created
October 17, 2022 07:52
-
-
Save EvanLyu732/24bac0aa21a05b1275bb18f1d928abaf to your computer and use it in GitHub Desktop.
spdlog.hpp.in corresponding cmake macro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Parameter: | |
# LOG MODULE: folder name | |
# BIND_PORT: network sinker register port | |
# SEND_PORT: network sinker publish port | |
macro(enable_logging LOG_MODULE BIND_PORT SEND_PORT) | |
if(NOT spdlog_FOUND) | |
find_package(spdlog REQUIRED) | |
endif() | |
if(NOT Boost_FOUND) | |
find_package(Boost REQUIRED COMPONENTS system) | |
endif() | |
set(LOG_MODULE LOG_MODULE) | |
set(BIND_PORT BIND_PORT) | |
set(SEND_PORT SEND_PORT) | |
# replace this line with your spdlog.hpp.in location. example | |
configure_file(${CMAKE_SOURCE_DIR}/include/spdlog.hpp.in ${CMAKE_SOURCE_DIR}/include/spdlog.hpp @ONLY) | |
endmacro() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment