From 70d59edc01c9978ada66615c033e941e40561bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Gawro=C5=84ski?= Date: Fri, 10 Nov 2023 17:59:54 +0100 Subject: [PATCH] Add gtest to Fetch content #550 (#551) --- CMakeLists.txt | 5 ++++- README.md | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d885ea1a8..55f6c4de7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,10 @@ if (NOT GTEST_ROOT) if (DEFINED ENV{GTEST_ROOT}) set(GTEST_ROOT $ENV{GTEST_ROOT}) else() - set(GTEST_ROOT "n/a" CACHE STRING "Path to root folder of googletest. Must be set for building the tests.") + include(FetchContent) + FetchContent_Declare(googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG v1.14.0) + FetchContent_Populate(googletest) + set(GTEST_ROOT ${googletest_SOURCE_DIR}) endif() endif() diff --git a/README.md b/README.md index 70be2290d..3fc4c8d77 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,7 @@ Optional: - A C++14 enabled compiler is needed (default for gcc >= v6.1). - vsomeip uses CMake as buildsystem. - vsomeip uses Boost >= 1.55.0: - -For the tests Google's test framework https://code.google.com/p/googletest/[gtest] is needed. --- URL: https://googletest.googlecode.com/files/gtest-.zip +- Google's test framework (downloaded automaticaly) To build the documentation asciidoc, source-highlight, doxygen and graphviz is needed: --`sudo apt-get install asciidoc source-highlight doxygen graphviz`