From 778b85a7a938edccdb77b6c4fc0610999131bc1a Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Fri, 5 Jan 2018 11:04:22 -0700 Subject: [PATCH] Prevent GTest and GMock from being installed with Google Benchmark. When users satisfy the GTest dependancy by placing a googletest directory in the project, the targets from GTest and GMock incorrectly get installed along side this library. We shouldn't be installing our test dependancies. This patch forces the options that control installation for googletest to OFF. --- cmake/HandleGTest.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/HandleGTest.cmake b/cmake/HandleGTest.cmake index c84f6539..77ffc4c5 100644 --- a/cmake/HandleGTest.cmake +++ b/cmake/HandleGTest.cmake @@ -67,6 +67,8 @@ endmacro(build_external_gtest) if (BENCHMARK_ENABLE_GTEST_TESTS) if (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/googletest) + set(INSTALL_GTEST OFF CACHE INTERNAL "") + set(INSTALL_GMOCK OFF CACHE INTERNAL "") add_subdirectory(${CMAKE_SOURCE_DIR}/googletest) set(GTEST_BOTH_LIBRARIES gtest gtest_main) elseif(BENCHMARK_DOWNLOAD_DEPENDENCIES)