From bb89b77f78bfba795c7846f5ce68430bd332685f Mon Sep 17 00:00:00 2001 From: Mika Lindqvist Date: Wed, 13 Apr 2022 04:24:12 +0300 Subject: [PATCH] Don't try to build tests or benchmarks if cmake is too old for them. --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e4e4b733..447d92ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1147,9 +1147,13 @@ option(ZLIB_ENABLE_TESTS "Build test binaries" ON) if(ZLIB_ENABLE_TESTS) enable_testing() - add_subdirectory(test) - if(WITH_BENCHMARKS) - add_subdirectory(test/benchmarks) + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) + add_subdirectory(test) + if(WITH_BENCHMARKS) + add_subdirectory(test/benchmarks) + endif() + else() + message(WARNING "Minimum cmake version of 3.12 not met for GoogleTest or benchmarks!") endif() macro(configure_test_executable target) -- 2.47.2