Commit 27cb792c522e22f5acc086740003e3e9e3374813
1 parent
9a1ac48a
Small cleanup to AddGoogleTest
Showing
1 changed file
with
2 additions
and
3 deletions
cmake/AddGoogletest.cmake
| ... | ... | @@ -4,7 +4,8 @@ |
| 4 | 4 | # gives output on failed tests without having to set an environment variable. |
| 5 | 5 | # |
| 6 | 6 | # |
| 7 | -set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | |
| 7 | +set(gtest_force_shared_crt CACHE INTERNAL ON) | |
| 8 | +set(BUILD_SHARED_LIBS OFF) | |
| 8 | 9 | |
| 9 | 10 | if(CMAKE_VERSION VERSION_LESS 3.11) |
| 10 | 11 | set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1") |
| ... | ... | @@ -19,7 +20,6 @@ if(CMAKE_VERSION VERSION_LESS 3.11) |
| 19 | 20 | # CMake warning suppression will not be needed in version 1.9 |
| 20 | 21 | set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS 1 CACHE BOOL "") |
| 21 | 22 | add_subdirectory(${googletest_SOURCE_DIR} ${googletest_SOURCE_DIR} EXCLUDE_FROM_ALL) |
| 22 | - unset(CMAKE_SUPPRESS_DEVELOPER_WARNINGS) | |
| 23 | 23 | else() |
| 24 | 24 | include(FetchContent) |
| 25 | 25 | FetchContent_Declare(googletest |
| ... | ... | @@ -30,7 +30,6 @@ else() |
| 30 | 30 | FetchContent_Populate(googletest) |
| 31 | 31 | set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS 1 CACHE BOOL "") |
| 32 | 32 | add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL) |
| 33 | - unset(CMAKE_SUPPRESS_DEVELOPER_WARNINGS) | |
| 34 | 33 | endif() |
| 35 | 34 | endif() |
| 36 | 35 | ... | ... |