From 864920a3c1a630633bc18e4f39c8d4abb35080d6 Mon Sep 17 00:00:00 2001 From: firewave Date: Sat, 28 Feb 2026 15:00:58 +0100 Subject: [PATCH] follow-up for #13050 - fixed CMake warning when `BUIULD_TESTS` is not actually provided --- cmake/options.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/options.cmake b/cmake/options.cmake index 4a315667093..67b34f7526b 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -56,7 +56,7 @@ option(BUILD_CORE_DLL "Build lib as cppcheck-core.dll with Visual Studio" if(BUILD_CORE_DLL AND NOT MSVC) message(FATAL_ERROR "Building of lib as DLL is only supported with Visual Studio") endif() -option(BUILD_TESTS "Build tests" OFF) +# need to check before the option() specifying it or it will be defined if(DEFINED BUILD_TESTS) message(WARNING "BUILD_TESTS has been deprecated and will be removed in Cppcheck 2.22 - please use BUILD_TESTING instead") if(DEFINED BUILD_TESTING) @@ -68,6 +68,7 @@ elseif(NOT DEFINED BUILD_TESTING) # disable tests by default - TODO: remove this set(BUILD_TESTING OFF) endif() +option(BUILD_TESTS "Build tests" OFF) option(REGISTER_TESTS "Register tests in CTest" ON) option(ENABLE_CHECK_INTERNAL "Enable internal checks" OFF) option(DISABLE_DMAKE "Disable run-dmake dependencies" OFF)