]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Don't try to build tests or benchmarks if cmake is too old for them.
authorMika Lindqvist <postmaster@raasu.org>
Wed, 13 Apr 2022 01:24:12 +0000 (04:24 +0300)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Fri, 22 Apr 2022 11:51:47 +0000 (13:51 +0200)
CMakeLists.txt

index e4e4b73327242cbe893ba828937af328009590ef..447d92aca7a3506cede42aa40be3312ec35eb736 100644 (file)
@@ -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)