blob: e53fca1b21a0a86c4a1ecd194843e99faa0313c2 [file] [log] [blame]
James Kuszmaulcf324122023-01-14 14:07:17 -08001include(FetchContent)
2
3FetchContent_Declare(
4 googletest
5 GIT_REPOSITORY https://github.com/google/googletest.git
6 GIT_TAG 58d77fa8070e8cec2dc1ed015d66b454c8d78850 # 1.12.1
7)
8
9FetchContent_GetProperties(googletest)
10if(NOT googletest_POPULATED)
11 FetchContent_Populate(googletest)
12
13 # Prevent overriding the parent project's compiler/linker
14 # settings on Windows
15 set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
16
17 add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
Brian Silverman8fce7482020-01-05 13:18:21 -080018endif()
19
James Kuszmaulcf324122023-01-14 14:07:17 -080020target_compile_features(gtest PUBLIC cxx_std_20)
21target_compile_features(gtest_main PUBLIC cxx_std_20)
James Kuszmaulb13e13f2023-11-22 20:44:04 -080022target_compile_features(gmock PUBLIC cxx_std_20)
23target_compile_features(gmock_main PUBLIC cxx_std_20)