From d5b1e63f9ad493a63d18bed02e6b9a7fd6ff5036 Mon Sep 17 00:00:00 2001 From: David Sankel Date: Tue, 8 Oct 2024 17:07:29 -0400 Subject: [PATCH] Remove CMAKE_ARGS parameter that wasn't working. CMAKE_ARGS isn't used when a directory is brought in via `add_subdirectory`. Instead, variables need to be set in a block. Additionally, the block is only needed for the `FetchContent_MakeAvailable` call. --- CMakeLists.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d81d8f0..a1a4550 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,11 +20,12 @@ if(BUILD_TESTING) GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG f8d7d77c06936315286eb55f8de22cd23c188571 # release-1.14.0 EXCLUDE_FROM_ALL - CMAKE_ARGS - -DBUILD_TESTING=OFF - -DINSTALL_GTEST=OFF - ) - FetchContent_MakeAvailable(googletest) + ) + block() + set(INSTALL_GTEST OFF) # Disable GoogleTest installation + set(BUILD_TESTING OFF) # Disable GoogleTest tests + FetchContent_MakeAvailable(googletest) + endblock() endif() add_subdirectory(src/beman/exemplar)