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()