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.
This commit is contained in:
David Zemon
2019-05-17 23:15:08 -05:00
parent 8dd85285e7
commit 55e7844ca0
3 changed files with 9 additions and 6 deletions

View File

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