From dcefe0bd5c14f87a80a39ed59fda435df6c2ffe5 Mon Sep 17 00:00:00 2001 From: coco875 <59367621+coco875@users.noreply.github.com> Date: Wed, 6 Aug 2025 13:25:12 +0200 Subject: [PATCH] fetch spdlog if it's not found --- CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 324d592..a450c87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -233,7 +233,16 @@ if(USE_STANDALONE) FetchContent_MakeAvailable(spdlog) target_link_libraries(${PROJECT_NAME} PRIVATE spdlog) else() - find_package(spdlog REQUIRED) + find_package(spdlog OPTIONAL) + if(NOT spdlog_FOUND) + FetchContent_Declare( + spdlog + GIT_REPOSITORY https://github.com/gabime/spdlog.git + GIT_TAG 7e635fca68d014934b4af8a1cf874f63989352b7 + ) + + FetchContent_MakeAvailable(spdlog) + endif() target_link_libraries(${PROJECT_NAME} PUBLIC spdlog::spdlog) endif()