James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 1 | include(FetchContent) |
| 2 | |
| 3 | FetchContent_Declare( |
| 4 | googletest |
| 5 | GIT_REPOSITORY https://github.com/google/googletest.git |
| 6 | GIT_TAG 58d77fa8070e8cec2dc1ed015d66b454c8d78850 # 1.12.1 |
| 7 | ) |
| 8 | |
| 9 | FetchContent_GetProperties(googletest) |
| 10 | if(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 Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 18 | endif() |
| 19 | |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 20 | target_compile_features(gtest PUBLIC cxx_std_20) |
| 21 | target_compile_features(gtest_main PUBLIC cxx_std_20) |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 22 | target_compile_features(gmock PUBLIC cxx_std_20) |
| 23 | target_compile_features(gmock_main PUBLIC cxx_std_20) |