We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8812393 commit 8bd66dcCopy full SHA for 8bd66dc
CMakeLists.txt
@@ -96,12 +96,17 @@ endif()
96
if (PHMAP_BUILD_TESTS)
97
98
if (NOT PHMAP_GTEST_LIBS)
99
- include(cmake/DownloadGTest.cmake)
100
-
101
- check_target(gtest)
102
- check_target(gtest_main)
103
- check_target(gmock)
104
- set(PHMAP_GTEST_LIBS gmock_main)
+ find_package(GTest CONFIG)
+ if (GTest_FOUND)
+ set(PHMAP_GTEST_LIBS GTest::gmock_main)
+ else()
+ include(cmake/DownloadGTest.cmake)
+
105
+ check_target(gtest)
106
+ check_target(gtest_main)
107
+ check_target(gmock)
108
+ set(PHMAP_GTEST_LIBS gmock_main)
109
+ endif()
110
endif()
111
112
enable_testing()
0 commit comments