force SPDLOG-library fetching (do not use of system one)
This commit is contained in:
@@ -72,13 +72,10 @@ endif()
|
|||||||
# ******* SPDLOG LIBRARY *******
|
# ******* SPDLOG LIBRARY *******
|
||||||
|
|
||||||
if(USE_SPDLOG)
|
if(USE_SPDLOG)
|
||||||
set(SPDLOG_USE_STD_FORMAT ON CACHE INTERNAL "Use of C++20 std::format")
|
|
||||||
set(SPDLOG_FMT_EXTERNAL OFF CACHE INTERNAL "Turn off external fmt library")
|
|
||||||
|
|
||||||
set(USE_SPDLOG_SYSTEM ON)
|
set(USE_SPDLOG_SYSTEM ON)
|
||||||
|
|
||||||
find_package(spdlog CONFIG)
|
# find_package(spdlog CONFIG NO_MODULE)
|
||||||
if(NOT ${spdlog_FOUND})
|
# if(NOT ${spdlog_FOUND})
|
||||||
message(STATUS "\tfetch spdlog-lib ...")
|
message(STATUS "\tfetch spdlog-lib ...")
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
spdlog
|
spdlog
|
||||||
@@ -93,13 +90,22 @@ if(USE_SPDLOG)
|
|||||||
OVERRIDE_FIND_PACKAGE
|
OVERRIDE_FIND_PACKAGE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(SPDLOG_USE_STD_FORMAT ON CACHE INTERNAL "Use of C++20 std::format")
|
||||||
|
set(SPDLOG_FMT_EXTERNAL OFF CACHE INTERNAL "Turn off external fmt library")
|
||||||
set(SPDLOG_INSTALL ON CACHE BOOL "Enable spdlog installation" FORCE)
|
set(SPDLOG_INSTALL ON CACHE BOOL "Enable spdlog installation" FORCE)
|
||||||
FetchContent_MakeAvailable(spdlog)
|
FetchContent_MakeAvailable(spdlog)
|
||||||
|
|
||||||
find_package(spdlog REQUIRED CONFIG)
|
# find_package(spdlog REQUIRED CONFIG)
|
||||||
|
|
||||||
set(USE_SPDLOG_SYSTEM OFF)
|
set(USE_SPDLOG_SYSTEM OFF)
|
||||||
endif()
|
# else()
|
||||||
|
# set(SPDLOG_USE_STD_FORMAT ON CACHE INTERNAL "Use of C++20 std::format")
|
||||||
|
# set(SPDLOG_FMT_EXTERNAL
|
||||||
|
# OFF
|
||||||
|
# CACHE INTERNAL
|
||||||
|
# "Turn off external fmt library"
|
||||||
|
# )
|
||||||
|
# endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# ******* ERFA LIBRARY *******
|
# ******* ERFA LIBRARY *******
|
||||||
@@ -312,12 +318,15 @@ if(USE_ASIO)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_SPDLOG)
|
if(USE_SPDLOG)
|
||||||
target_link_libraries(${PROJECT_NAME} INTERFACE spdlog::spdlog_header_only)
|
|
||||||
# target_compile_definitions(${PROJECT_NAME} INTERFACE SPDLOG_USE_STD_FORMAT=1 SPDLOG_FMT_EXTERNAL=0)
|
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
${PROJECT_NAME}
|
${PROJECT_NAME}
|
||||||
INTERFACE SPDLOG_USE_STD_FORMAT=1
|
INTERFACE SPDLOG_USE_STD_FORMAT=1 SPDLOG_FMT_EXTERNAL=0
|
||||||
)
|
)
|
||||||
|
target_link_libraries(${PROJECT_NAME} INTERFACE spdlog::spdlog_header_only)
|
||||||
|
# target_compile_definitions(
|
||||||
|
# ${PROJECT_NAME}
|
||||||
|
# INTERFACE SPDLOG_USE_STD_FORMAT=1
|
||||||
|
# )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTS)
|
if(BUILD_TESTS)
|
||||||
|
|||||||
Reference in New Issue
Block a user