Skip to content

Commit

Permalink
Search system for GTest before downloading. #654
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thesamesam authored and nmoinvaz committed Nov 19, 2022
1 parent 537cbf7 commit 27b8e31
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.12)

include(FetchContent)

find_package(GTest)

enable_language(CXX)

if(NOT TARGET GTest::GTest)
Expand Down

0 comments on commit 27b8e31

Please sign in to comment.