diff --git a/CMakeLists.txt b/CMakeLists.txt index 856bc98b..74b99341 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -267,7 +267,9 @@ add_subdirectory(src) if (BENCHMARK_ENABLE_TESTING) enable_testing() - if (BENCHMARK_ENABLE_GTEST_TESTS) + if (BENCHMARK_ENABLE_GTEST_TESTS AND + NOT (TARGET gtest AND TARGET gtest_main AND + TARGET gmock AND TARGET gmock_main)) include(GoogleTest) endif() add_subdirectory(test)