summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoco875 <59367621+coco875@users.noreply.github.com>2025-08-06 13:25:12 +0200
committerLywx <kiritodev01@gmail.com>2025-08-06 09:16:54 -0600
commitdcefe0bd5c14f87a80a39ed59fda435df6c2ffe5 (patch)
treecbf2e91cea1852552ec51fc5ac9d1c7967908227
parent6e6a0a8983a073465a5e869be061325134543e63 (diff)
fetch spdlog if it's not found
-rw-r--r--CMakeLists.txt11
1 files changed, 10 insertions, 1 deletions
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()