CMake improvements

This commit is contained in:
gabime
2019-05-29 00:04:36 +03:00
parent 5709cb10d1
commit 30bd80bd85
4 changed files with 44 additions and 24 deletions

View File

@@ -2,15 +2,9 @@
# Distributed under the MIT License (http://opensource.org/licenses/MIT)
cmake_minimum_required(VERSION 3.1)
project(SpdlogExamples CXX)
project(spdlog_examples CXX)
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)
add_library(spdlog::spdlog_header_only ALIAS spdlog_header_only)
else()
if(NOT TARGET spdlog)
# Stand-alone build
find_package(spdlog REQUIRED)
endif()