From 6dd47f5de52172c62feb6dabed51e1837c896278 Mon Sep 17 00:00:00 2001 From: Petra Baranski Date: Sun, 23 Jul 2023 05:36:57 +0200 Subject: [PATCH] build: move gtest into cmake and up cmake min version cmake minimum required version is now 3.25. Instead of loading gtest via git submodule, it is now loaded in the cmake files. gtest version upped to v1.13.0. --- .gitmodules | 3 --- CHANGELOG.md | 2 ++ CMakeLists.txt | 4 +--- libs/CMakeLists.txt | 17 +++++++---------- libs/gtest | 1 - 5 files changed, 10 insertions(+), 17 deletions(-) delete mode 100644 .gitmodules delete mode 160000 libs/gtest diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index a692fc2..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "libs/gtest"] - path = libs/gtest - url = https://github.com/google/googletest.git diff --git a/CHANGELOG.md b/CHANGELOG.md index 0acd92d..72633bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ maddy uses [semver versioning](https://semver.org/). * ![**ADDED**](https://img.shields.io/badge/-ADDED-%23099) Added Changelog * ![**ADDED**](https://img.shields.io/badge/-ADDED-%23099) Added contribution guideline +* ![**CHANGED**](https://img.shields.io/badge/-CHANGED-%23e90) updated cmake minimum required version to 3.25 +* ![**CHANGED**](https://img.shields.io/badge/-CHANGED-%23e90) gtest is now loaded via cmake and not a git submodule any longer - updated gtest version to 1.13.0 * ? ## version 1.1.2 2020-10-04 diff --git a/CMakeLists.txt b/CMakeLists.txt index ec6649f..526e905 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # This project is licensed under the MIT license. For more information see the # LICENSE file. -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.25) project(maddy) @@ -54,8 +54,6 @@ endif() # ------------------------------------------------------------------------------ -set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libs/gtest/googlemock) add_subdirectory(libs) # ------------------------------------------------------------------------------ diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index ec8335f..6391206 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -1,14 +1,11 @@ # This project is licensed under the MIT license. For more information see the # LICENSE file. -cmake_minimum_required(VERSION 2.8) +include(FetchContent) -set(LIBS_INCLUDE_DIRS -# -- googletest / -mock -------------------------------------------------------- - ${CMAKE_CURRENT_SOURCE_DIR}/gtest/googletest/include - ${CMAKE_CURRENT_SOURCE_DIR}/gtest/googlemock/include -# ------------------------------------------------------------------------------ -PARENT_SCOPE) - -set(LIBS_SRC_FILES -PARENT_SCOPE) +FetchContent_Declare( + googletest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG b796f7d44681514f58a683a3a71ff17c94edb0c1 # v1.13.0 +) +FetchContent_MakeAvailable(googletest) diff --git a/libs/gtest b/libs/gtest deleted file mode 160000 index 703bd9c..0000000 --- a/libs/gtest +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 703bd9caab50b139428cea1aaff9974ebee5742e