From 20f10677d40d217caef44e5e63e79dc9e4232650 Mon Sep 17 00:00:00 2001 From: Dimitrij Mijoski Date: Wed, 14 Sep 2022 15:51:17 +0200 Subject: [PATCH 1/2] Revert "Fix compatibility with cmake 3.8" This reverts commit 47d56f28a9801911c048d011b375e5631dbb658f. --- CMakeLists.txt | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae8e86b9b9..7233477fb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,24 +30,22 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt") endif() -if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.9) +if(CMAKE_VERSION VERSION_GREATER 3.8) # Enable IPO for CMake versions that support it cmake_policy(SET CMP0069 NEW) - project(Catch2 - VERSION 3.1.0 # CML version placeholder, don't delete - LANGUAGES CXX - # HOMEPAGE_URL is not supported until CMake version 3.12, which - # we do not target yet. - # HOMEPAGE_URL "https://github.com/catchorg/Catch2" - DESCRIPTION "A modern, C++-native, unit test framework." - ) -else() - project(Catch2 - VERSION 3.1.0 # CML version placeholder, don't delete - LANGUAGES CXX - ) endif() + +project(Catch2 + VERSION 3.1.0 # CML version placeholder, don't delete + LANGUAGES CXX + # HOMEPAGE_URL is not supported until CMake version 3.12, which + # we do not target yet. + # HOMEPAGE_URL "https://github.com/catchorg/Catch2" + DESCRIPTION "A modern, C++-native, unit test framework." +) + + # Provide path for scripts. We first add path to the scripts we don't use, # but projects including us might, and set the path up to parent scope. # Then we also add path that we use to configure the project, but is of From 7c4e3b20252c1745f0993689ef0d3f4228bad0bd Mon Sep 17 00:00:00 2001 From: Dimitrij Mijoski Date: Fri, 16 Sep 2022 11:11:24 +0200 Subject: [PATCH 2/2] Raise the minimum CMake version to 3.10 --- CMakeLists.txt | 8 +------- examples/CMakeLists.txt | 2 +- tests/ExtraTests/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7233477fb0..be12d516c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) # detect if Catch is being bundled, # disable testsuite in that case @@ -30,12 +30,6 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt") endif() -if(CMAKE_VERSION VERSION_GREATER 3.8) - # Enable IPO for CMake versions that support it - cmake_policy(SET CMP0069 NEW) -endif() - - project(Catch2 VERSION 3.1.0 # CML version placeholder, don't delete LANGUAGES CXX diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index b934aa7cd7..7118482eaf 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required( VERSION 3.5 ) +cmake_minimum_required( VERSION 3.10 ) project( Catch2Examples LANGUAGES CXX ) diff --git a/tests/ExtraTests/CMakeLists.txt b/tests/ExtraTests/CMakeLists.txt index f1a02af3f6..0943a9c370 100644 --- a/tests/ExtraTests/CMakeLists.txt +++ b/tests/ExtraTests/CMakeLists.txt @@ -2,7 +2,7 @@ # Build extra tests. # -cmake_minimum_required( VERSION 3.5 ) +cmake_minimum_required( VERSION 3.10 ) project( Catch2ExtraTests LANGUAGES CXX )