From: Mika Lindqvist Date: Wed, 13 Apr 2022 01:24:12 +0000 (+0300) Subject: Don't try to build tests or benchmarks if cmake is too old for them. X-Git-Tag: 2.1.0-beta1~267 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb89b77f78bfba795c7846f5ce68430bd332685f;p=thirdparty%2Fzlib-ng.git Don't try to build tests or benchmarks if cmake is too old for them. --- 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)