diff options
author | David Zemon <david@zemon.name> | 2019-05-18 07:15:08 +0300 |
---|---|---|
committer | David Zemon <david@zemon.name> | 2019-05-18 07:27:44 +0300 |
commit | 55e7844ca079c31d798aeb77339df404fcc1626a (patch) | |
tree | e08990c61629d10f5980bd06fc92e5fdb4b81425 /example | |
parent | 8dd85285e7a87a1a7347f3d6b4d409e4eed44eb6 (diff) |
Remove the namespaced
Namespaces are good for avoiding collisions, but since the
non-namespaced targets still exist, it does no good to add the
namespaced targets on top.
Diffstat (limited to 'example')
-rw-r--r-- | example/CMakeLists.txt | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 98bdca6e..9dc977e7 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -24,9 +24,14 @@ cmake_minimum_required(VERSION 3.1) project(SpdlogExamples CXX) -if(NOT TARGET spdlog::spdlog) - # Stand-alone build - find_package(spdlog CONFIG REQUIRED) +if(TARGET spdlog) + # If we're running this example as part of the primary spdlog applciation + # then add an alias. This allows us to use the same "spdlog::spdlog" + # below that a user would use (with the namespace) + add_library(spdlog::spdlog ALIAS spdlog) +else() + # Stand-alone build + find_package(spdlog REQUIRED) endif() find_package(Threads REQUIRED) |