From a1308955e76cece4d46a8619aea95ce3ac31bb7e Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Wed, 24 Oct 2018 13:03:50 +0200 Subject: [PATCH] Use CMake's BUILD_TESTING instead of proprietary custom variable --- CMakeLists.txt | 5 ++--- lib/CMakeLists.txt | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 62ce776..f753055 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,7 @@ add_subdirectory(lib) add_subdirectory(src) -option(BUILD_TEST "Build the tests" ON) -if(BUILD_TEST) - enable_testing() +include(CTest) +if(BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 7f822ce..0c22dcd 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -109,4 +109,7 @@ if(NOT USE_SYSTEM_BOOST) ) endif() -add_subdirectory(googletest) +include(CTest) +if(BUILD_TESTING) + add_subdirectory(googletest) +endif()