[PATCH] Don't install embedded copy of GTest
authorPhil Miller <phil.miller@intensecomputing.com>
Tue, 7 Feb 2023 20:42:40 +0000 (15:42 -0500)
committerGianfranco Costamagna <locutusofborg@debian.org>
Fri, 3 Oct 2025 15:35:05 +0000 (17:35 +0200)
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

Gbp-Pq: Name 1171.patch

test/CMakeLists.txt

index bc239a5526fc612b29dec4357a21201456f802ec..1c60c07c556f760ab368d26fd0f5963f3908058e 100644 (file)
@@ -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)