From 1d1fd885546709ee4dd3960492065591ede73b51 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Tue, 2 Apr 2019 14:58:25 -0600 Subject: [PATCH] build: Don't ship GTEST headers in install target A project that uses googletest(GTEST) shouldn't include googletest headers with its artifacts in its install target. These headers simply are not needed by the consumers of the install target and can cause conflicts with other projects that use googletest themselves and this project's install target. And they are just not part of the expected glslang build artifacts. It is likely that the addition of the googletest headers to the install target was a simple oversight that happens as a result of adding googletest as a CMake subdirectory. For more information on how this causes conflicts with other projects, please see: https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/821. --- External/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/External/CMakeLists.txt b/External/CMakeLists.txt index 4d9690134a..6ff4f47acd 100644 --- a/External/CMakeLists.txt +++ b/External/CMakeLists.txt @@ -10,7 +10,8 @@ if(BUILD_TESTING) if(WIN32) set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) endif(WIN32) - add_subdirectory(googletest) + # EXCLUDE_FROM_ALL keeps the install target from installing GTEST files. + add_subdirectory(googletest EXCLUDE_FROM_ALL) set(GTEST_TARGETS gtest gtest_main