File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -40,15 +40,25 @@ else()
4040 FetchContent_Declare(
4141 gtest
4242 URL ${dependency_url}
43- EXCLUDE_FROM_ALL
44- QUIET
43+ EXCLUDE_FROM_ALL
44+ QUIET
4545 )
4646endif ()
4747
48+ # Make sure that GTest does not try to install itself
49+ set (INSTALL_GTEST OFF )
50+ set (BUILD_GMOCK OFF )
51+
52+
53+ FetchContent_MakeAvailable(gtest)
54+
4855# For Windows: Prevent overriding the parent project's compiler/linker settings.
4956# This will force generation of a shared library for gtest.
50- set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
57+ if (MSVC )
58+ set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
59+ endif ()
60+
61+ set_target_properties (gtest_main PROPERTIES EXCLUDE_FROM_ALL TRUE ) # for gtest_main (not used)
5162
52- FetchContent_MakeAvailable(gtest)
5363
5464set (gtest_INCLUDE_DIR "${gtest_SOURCE_DIR} /googletest/include" )
You can’t perform that action at this time.
0 commit comments