force SPDLOG-library fetching (do not use of system one)
This commit is contained in:
@@ -72,34 +72,40 @@ endif()
|
||||
# ******* SPDLOG LIBRARY *******
|
||||
|
||||
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)
|
||||
|
||||
find_package(spdlog CONFIG)
|
||||
if(NOT ${spdlog_FOUND})
|
||||
message(STATUS "\tfetch spdlog-lib ...")
|
||||
FetchContent_Declare(
|
||||
spdlog
|
||||
GIT_REPOSITORY "https://github.com/gabime/spdlog.git"
|
||||
GIT_TAG "v1.15.1"
|
||||
GIT_SHALLOW TRUE
|
||||
GIT_SUBMODULES ""
|
||||
GIT_PROGRESS TRUE
|
||||
# CMAKE_ARGS
|
||||
# -DSPDLOG_USE_STD_FORMAT=ON
|
||||
# -DSPDLOG_FMT_EXTERNAL=OFF
|
||||
OVERRIDE_FIND_PACKAGE
|
||||
)
|
||||
# find_package(spdlog CONFIG NO_MODULE)
|
||||
# if(NOT ${spdlog_FOUND})
|
||||
message(STATUS "\tfetch spdlog-lib ...")
|
||||
FetchContent_Declare(
|
||||
spdlog
|
||||
GIT_REPOSITORY "https://github.com/gabime/spdlog.git"
|
||||
GIT_TAG "v1.15.1"
|
||||
GIT_SHALLOW TRUE
|
||||
GIT_SUBMODULES ""
|
||||
GIT_PROGRESS TRUE
|
||||
# CMAKE_ARGS
|
||||
# -DSPDLOG_USE_STD_FORMAT=ON
|
||||
# -DSPDLOG_FMT_EXTERNAL=OFF
|
||||
OVERRIDE_FIND_PACKAGE
|
||||
)
|
||||
|
||||
set(SPDLOG_INSTALL ON CACHE BOOL "Enable spdlog installation" FORCE)
|
||||
FetchContent_MakeAvailable(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(SPDLOG_INSTALL ON CACHE BOOL "Enable spdlog installation" FORCE)
|
||||
FetchContent_MakeAvailable(spdlog)
|
||||
|
||||
find_package(spdlog REQUIRED CONFIG)
|
||||
# find_package(spdlog REQUIRED CONFIG)
|
||||
|
||||
set(USE_SPDLOG_SYSTEM OFF)
|
||||
endif()
|
||||
set(USE_SPDLOG_SYSTEM OFF)
|
||||
# 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()
|
||||
|
||||
# ******* ERFA LIBRARY *******
|
||||
@@ -312,12 +318,15 @@ if(USE_ASIO)
|
||||
endif()
|
||||
|
||||
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(
|
||||
${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()
|
||||
|
||||
if(BUILD_TESTS)
|
||||
|
||||
Reference in New Issue
Block a user