From 1c31800210e3126c565db1f104e95ad6dfe35a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Tue, 22 Nov 2016 10:20:13 +0100 Subject: [PATCH] cmake: Use a standard option for controlling the tests As per the docs [1], there's a standard variable for this purpose. This introduces a behavior change, the tests are now being built by default. [1] https://cmake.org/cmake/help/v3.0/module/CTest.html --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa1d45a7..215872ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ cmake_minimum_required(VERSION 3.1) project(spdlog VERSION 1.0.0) +include(CTest) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -12,7 +13,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) add_library(spdlog INTERFACE) option(SPDLOG_BUILD_EXAMPLES "Build examples" OFF) -option(SPDLOG_BUILD_TESTS "Build tests" OFF) target_include_directories( spdlog @@ -28,7 +28,7 @@ if(SPDLOG_BUILD_EXAMPLES) add_subdirectory(example) endif() -if(SPDLOG_BUILD_TESTS) +if(BUILD_TESTING) add_subdirectory(tests) endif()