Skip to content

Commit

Permalink
drop gtest fetch content
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhhughes committed Jun 24, 2024
1 parent f111dd8 commit c0dd0cc
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions config_utilities/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG b796f7d44681514f58a683a3a71ff17c94edb0c1 # v1.13.0
INSTALL_COMMAND "")

# note that FetchContent_MakeAvailable automatically installs any added
# fetch-content project, see:
# https://stackoverflow.com/questions/65527126/disable-install-for-fetchcontent
FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
FetchContent_Populate(googletest)
# We want to build static gtest libraries to avoid issues, so we have to cache
# and reset the relevant variables, see:
# https://stackoverflow.com/questions/62101576/using-fetchcontent-declare-together-with-cmake-args
set(BUILD_SHARED_LIBS_THIS ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS
OFF
CACHE INTERNAL "Build static libraries")
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR}
EXCLUDE_FROM_ALL)
set(BUILD_SHARED_LIBS
${BUILD_SHARED_LIBS_THIS}
CACHE BOOL "Build SHARED libraries")
endif()

find_package(GTest REQUIRED)
include(GoogleTest)
enable_testing()

Expand Down

0 comments on commit c0dd0cc

Please sign in to comment.