Created
November 1, 2021 09:48
-
-
Save cbandera/e3ffea9c645b216ca456edf4c86153bb to your computer and use it in GitHub Desktop.
Add Googletest to CMake via FetchContent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include(FetchContent) | |
FetchContent_Declare( | |
googletest | |
GIT_REPOSITORY https://github.com/google/googletest.git | |
GIT_TAG release-1.11.0 | |
) | |
FetchContent_GetProperties(googletest) | |
if(NOT googletest_POPULATED) | |
FetchContent_Populate(googletest) | |
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR}) | |
endif() | |
# For Windows: Prevent overriding the parent project's compiler/linker settings | |
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment