From ed8a62f1cdca19c09caf52f2e36f45dafaa9cff8 Mon Sep 17 00:00:00 2001 From: Thijs Paelman Date: Mon, 3 Nov 2025 22:40:55 +0100 Subject: build: Only add tests when BUILD_TESTING is ON By default, BUILD_TESTING = ON due to the inclusion of the CTest module. Signed-off-by: Thijs Paelman Signed-off-by: Sander Vrijders --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ffa5bf4..cd2bffee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,7 +179,10 @@ else () message(STATUS "Systemd service installation disabled by user") endif() -enable_testing() +include(CTest) # Sets BUILD_TESTING by default to on. +# BUILD_TESTS: control if tests are included by CMAKE. +# Can depend on more than only BUILD_TESTING in the future. +set(BUILD_TESTS ${BUILD_TESTING}) add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) find_package(ProtobufC QUIET) -- cgit v1.2.3