From b0d46afbbde97d2a799ef1ecb1ded51e750ff3d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Kindstr=C3=B6m?= Date: Thu, 4 Oct 2018 12:50:28 +0200 Subject: [PATCH] Fix cmake builds when cmake version < 3.10 --- logdevice/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/logdevice/CMakeLists.txt b/logdevice/CMakeLists.txt index 19bbc3fe97b4..7d92d23bf12d 100644 --- a/logdevice/CMakeLists.txt +++ b/logdevice/CMakeLists.txt @@ -20,7 +20,11 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) project(${PACKAGE_NAME} CXX) enable_testing() -include(GoogleTest OPTIONAL RESULT_VARIABLE HAVE_CMAKE_GTEST) +# gtest_discover_tests was introduced in cmake 3.10 +if(${CMAKE_VERSION} VERSION_EQUAL "3.10" OR ${CMAKE_VERSION} VERSION_GREATER "3.10") + include(GoogleTest OPTIONAL RESULT_VARIABLE HAVE_CMAKE_GTEST) +endif() + include (logdevice-functions) include(build-config)