From 27b8e31e9d8efb4b99df6bd20319b205e8d1136d Mon Sep 17 00:00:00 2001 From: Sam James Date: Sat, 19 Nov 2022 03:09:34 +0000 Subject: [PATCH] Search system for GTest before downloading. #654 Distributions often do builds with no network access available for both security reasons and also to ensure reproducibility. This change tells CMake to query the system for a copy of gtest, but if it's not available, it'll fall back to downloading via FetchContent. --- test/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4a6102ed..e37ca92f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.12) include(FetchContent) +find_package(GTest) + enable_language(CXX) if(NOT TARGET GTest::GTest)