James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 1 | include(FetchContent) |
| 2 | |
Maxwell Henderson | 80bec32 | 2024-01-09 15:48:44 -0800 | [diff] [blame^] | 3 | fetchcontent_declare( |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 4 | googletest |
Maxwell Henderson | 80bec32 | 2024-01-09 15:48:44 -0800 | [diff] [blame^] | 5 | GIT_REPOSITORY https://github.com/google/googletest.git |
| 6 | GIT_TAG |
| 7 | 58d77fa8070e8cec2dc1ed015d66b454c8d78850 # 1.12.1 |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 8 | ) |
| 9 | |
Maxwell Henderson | 80bec32 | 2024-01-09 15:48:44 -0800 | [diff] [blame^] | 10 | fetchcontent_getproperties(googletest) |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 11 | if(NOT googletest_POPULATED) |
Maxwell Henderson | 80bec32 | 2024-01-09 15:48:44 -0800 | [diff] [blame^] | 12 | fetchcontent_populate(googletest) |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 13 | |
| 14 | # Prevent overriding the parent project's compiler/linker |
| 15 | # settings on Windows |
| 16 | set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) |
| 17 | |
| 18 | add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL) |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 19 | endif() |
| 20 | |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 21 | target_compile_features(gtest PUBLIC cxx_std_20) |
| 22 | target_compile_features(gtest_main PUBLIC cxx_std_20) |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 23 | target_compile_features(gmock PUBLIC cxx_std_20) |
| 24 | target_compile_features(gmock_main PUBLIC cxx_std_20) |