Merge pull request #831 from taketwo/fix-830

Change the default value for SPDLOG_BUILD_xxx
This commit is contained in:
Gabi Melman 2018-09-12 23:33:36 +03:00 committed by GitHub
commit 188cff7d65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,11 +45,17 @@ include(cmake/sanitizers.cmake)
add_library(spdlog INTERFACE) add_library(spdlog INTERFACE)
add_library(spdlog::spdlog ALIAS spdlog) add_library(spdlog::spdlog ALIAS spdlog)
option(SPDLOG_BUILD_EXAMPLES "Build examples" ON) # Check if spdlog is being used directly or via add_subdirectory
option(SPDLOG_BUILD_BENCH "Build benchmarks" ON) set(SPDLOG_MASTER_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(SPDLOG_MASTER_PROJECT ON)
endif()
option(SPDLOG_BUILD_EXAMPLES "Build examples" ${SPDLOG_MASTER_PROJECT})
option(SPDLOG_BUILD_BENCH "Build benchmarks" ${SPDLOG_MASTER_PROJECT})
cmake_dependent_option(SPDLOG_BUILD_TESTING cmake_dependent_option(SPDLOG_BUILD_TESTING
"Build spdlog tests" ON "Build spdlog tests" ${SPDLOG_MASTER_PROJECT}
"BUILD_TESTING" OFF "BUILD_TESTING" OFF
) )