2022-07-29 Building Catch tests with CMake Tags: cmake catch testingcmake_minimum_required(VERSION 3.15) # By default don't build the tests. # This has to be set before the project declaration. # Enable with cmake -DBUILD_TESTING=ON OPTION(BUILD_TESTING "Build tests" OFF) project(ProjectName) include(CTest) # ... # your main CMakeLists.txt content # ... if(BUILD_TESTING) add_subdirectory(tests) endif()