aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1b18c9d..b541bca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,6 +31,10 @@ if(NOT COMMAND add_sanitizers)
endif()
if(BUILD_TESTS)
+ find_package(GTest QUIET)
+ if(TARGET GTest::Main)
+ add_library(gtest_main ALIAS GTest::Main)
+ endif()
if(NOT TARGET gtest_main)
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/googletest/CMakeLists.txt")
message(FATAL_ERROR "Could not find googletest: run\n\tgit submodule update --init --recursive\nin base git checkout")