From 21ccce8406fa7af356cd7a7e104036cbc61d8874 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 25 Oct 2024 21:39:16 +0200 Subject: [PATCH] CMake: use enable_testing() instead of include(CTest) According to Craig Scott in https://discourse.cmake.org/t/is-there-any-reason-to-prefer-include-ctest-or-enable-testing-over-the-other/1905/2 , using include(CTest) adds unnecessary clutter that is only needed for dashboard submission. enable_testing() is enough otherwise "Port" of https://github.com/OSGeo/shapelib/pull/162 --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dcf03178f..9cc9693f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -382,9 +382,12 @@ add_subdirectory(capi) #----------------------------------------------------------------------------- # Tests #----------------------------------------------------------------------------- + +option(BUILD_TESTING "Build the testing tree." ON) + if(PROJECT_IS_TOP_LEVEL) - include(CTest) if(BUILD_TESTING) + enable_testing() add_subdirectory(tests) endif() endif()