From 24e4f0aa872d1fb600520fcf9f57bb9a9cfcfbb7 Mon Sep 17 00:00:00 2001 From: David Zemon Date: Fri, 17 May 2019 23:31:30 -0500 Subject: [PATCH] Allowed overriding of `SPDLOG_MASTER_PROJECT` to better support Conan --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ef3b16f..ba146ca1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,12 +38,14 @@ include(cmake/sanitizers.cmake) # spdlog target #--------------------------------------------------------------------------------------- -# Check if spdlog is being used directly or via add_subdirectory +# Check if spdlog is being used directly or via add_subdirectory, but allow overriding +if (NOT DEFINED SPDLOG_MASTER_PROJECT) if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) set(SPDLOG_MASTER_PROJECT ON) else() set(SPDLOG_MASTER_PROJECT OFF) endif() +endif () option(BUILD_SHARED_LIBS "Global flag to cause add_library to create shared libraries if on." ON) option(SPDLOG_BUILD_EXAMPLES "Build examples" ${SPDLOG_MASTER_PROJECT})