From: Simon Quigley Date: Sat, 13 Nov 2021 20:48:59 +0000 (+0000) Subject: Use the googletest provided by the archive instead of the embedded copy X-Git-Tag: archive/raspbian/0.7.0+dfsg-8+rpi1~1^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4d280d3e9aefb3907823671b18aa34ac8ea3b371;p=yaml-cpp.git Use the googletest provided by the archive instead of the embedded copy Forwarded: https://github.com/jbeder/yaml-cpp/pull/1035 Last-Update: 2021-09-24 Gbp-Pq: Name use-archive-googletest.patch --- diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5ebc1a6..34be1fe 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,11 +4,18 @@ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) set(BUILD_MOCK ON CACHE BOOL "" FORCE) set(CMAKE_POLICY_DEFAULT_CMP0048 NEW) -add_subdirectory( - "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.10.0" - "${CMAKE_CURRENT_BINARY_DIR}/prefix") - -include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.10.0/googletest/include") +find_package(GTest) +if (NOT GTEST_FOUND) + add_subdirectory( + "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.10.0" + "${CMAKE_CURRENT_BINARY_DIR}/prefix") + include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.10.0/googletest/include") +else() + add_subdirectory( + "/usr/src/googletest" + "${CMAKE_CURRENT_BINARY_DIR}/prefix") + include_directories(SYSTEM "/usr/src/googletest/googlemock/include") +endif() set(test-new-api-pattern "new-api/*.cpp") set(test-source-pattern "*.cpp" "integration/*.cpp" "node/*.cpp")