You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cmake/FetchGoogleTest.cmake

19 lines
649 B
CMake

# usage:
# FetchContent_MakeAvailable(googletest)
# target_link_libraries(${PROJECT_NAME} PRIVATE googletest)
#
# further reading: https://google.github.io/googletest/quickstart-cmake.html
if (NOT DEFINED GOOGLE_TEST_GIT_TAG)
message(FATAL_ERROR "GOOGLE_TEST_GIT_TAG is not defined.\n see https://github.com/google/googletest and grab a release tag.\n example: set(GOOGLE_TEST_GIT_TAG v1.13.0)")
endif()
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG ${GOOGLE_TEST_GIT_TAG}
)
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
print_git_tag(${GOOGLE_TEST_GIT_TAG})