mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-29 08:34:39 +08:00
CMakeLists.txt: use external gtest, fallback to fetching the source (#288)
See: https://github.com/greg7mdp/parallel-hashmap/issues/287
This commit is contained in:
Vendored
+10
-5
@@ -96,12 +96,17 @@ endif()
|
|||||||
if (PHMAP_BUILD_TESTS)
|
if (PHMAP_BUILD_TESTS)
|
||||||
|
|
||||||
if (NOT PHMAP_GTEST_LIBS)
|
if (NOT PHMAP_GTEST_LIBS)
|
||||||
include(cmake/DownloadGTest.cmake)
|
find_package(GTest CONFIG)
|
||||||
|
if (GTest_FOUND)
|
||||||
|
set(PHMAP_GTEST_LIBS GTest::gmock_main)
|
||||||
|
else()
|
||||||
|
include(cmake/DownloadGTest.cmake)
|
||||||
|
|
||||||
check_target(gtest)
|
check_target(gtest)
|
||||||
check_target(gtest_main)
|
check_target(gtest_main)
|
||||||
check_target(gmock)
|
check_target(gmock)
|
||||||
set(PHMAP_GTEST_LIBS gmock_main)
|
set(PHMAP_GTEST_LIBS gmock_main)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|||||||
Reference in New Issue
Block a user