diff options
author | Andrea Pappacoda <[email protected]> | 2021-09-19 17:17:02 +0200 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2021-11-01 20:28:31 +1300 |
commit | 72f959807d5723c77576e52b1c2b33c28b55f246 (patch) | |
tree | 8051f38fec14987a6a3a03ebad0985f6e420f4f1 /CMakeLists.txt | |
parent | d512bfa07a327e0ae7e7aef892dcce01cbeaa67c (diff) | |
download | cubeb-72f959807d5723c77576e52b1c2b33c28b55f246.tar.gz cubeb-72f959807d5723c77576e52b1c2b33c28b55f246.zip |
build(cmake): use system GTest when available
This speeds up compilation times and makes downstream packaging easier.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 4 |
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") |