From 0ef66db8319eea8a86a188fdbe9a9a9499eec2d8 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Wed, 21 Feb 2024 08:51:07 -0800 Subject: [PATCH] Now try FetchContent --- third_party/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index a0e3f54b..92a48db2 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -11,14 +11,14 @@ add_subdirectory(fmt) find_package(GTest QUIET CONFIG) if(NOT ${GTEST_FOUND}) - message(STATUS "Using bundled GoogleTest library.") - include(ExternalProject) - ExternalProject_Add( - GTest - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest - INSTALL_COMMAND "" + message(STATUS "Retrieving external GoogleTest library.") + include(FetchContent) + FetchContent_Declare(GTest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG v1.14.0 + OVERRIDE_FIND_PACKAGE ) + FetchContent_MakeAvailable(GTest) endif() add_subdirectory(protobuf-matchers)