Skip to content

Commit

Permalink
Don't install embedded copy of GTest
Browse files Browse the repository at this point in the history
Goole Test itself documents the `INSTALL_GTEST` option as something that projects embedding it should set to `OFF`. Leaving it on means that projects downstream from libraries that embed it are likely to encounter conflicting copies. This is particularly annoying because GTest does not maintain anything like a stable API, and so causes builds to fail if include paths pick up an inappropriately installed copy ahead of the one that the code wanted.

Fixes #488
  • Loading branch information
PhilMiller authored and jbeder committed Dec 17, 2024
1 parent 9ce5a25 commit f878043
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ find_package(Threads REQUIRED)

set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
set(BUILD_MOCK ON CACHE BOOL "" FORCE)
set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
set(CMAKE_POLICY_DEFAULT_CMP0048 NEW)

if(YAML_USE_SYSTEM_GTEST)
Expand Down

0 comments on commit f878043

Please sign in to comment.