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>)