From 2a0db06e7b3f41ea1a8bd4cc157f112174e8a14a Mon Sep 17 00:00:00 2001 From: gabime Date: Sun, 1 Dec 2024 18:22:33 +0200 Subject: [PATCH] Updated cmakelists.txt --- example/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 98ee6996..90211423 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -3,7 +3,10 @@ cmake_minimum_required(VERSION 3.14) project(spdlog_example CXX) -find_package(spdlog REQUIRED) +if(NOT TARGET spdlog) + # Stand-alone build + find_package(spdlog REQUIRED) +endif() add_executable(example example.cpp) -target_link_libraries(example PRIVATE spdlog $<$:ws2_32>) +target_link_libraries(example PRIVATE spdlog::spdlog $<$:ws2_32>)