From 7b040896ee4bd6e0c5652413c9a4b8e054665e43 Mon Sep 17 00:00:00 2001 From: Jonathan Lifflander Date: Wed, 9 Aug 2023 09:51:10 -0700 Subject: [PATCH] #2174: tests: only add gtest if it doesn't exist already --- tests/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e0d10b060e..b7fbec95cb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -44,7 +44,9 @@ subdirlist( set(BUILD_GMOCK OFF CACHE BOOL "Builds the googlemock subproject" FORCE) set(INSTALL_GTEST OFF CACHE BOOL "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" FORCE) -add_subdirectory(extern/googletest) +if (NOT TARGET gtest) + add_subdirectory(extern/googletest) +endif() set(GOOGLETEST_LIBRARY gtest) set_darma_compiler_flags(${GOOGLETEST_LIBRARY})