Skip to content

Commit 5c1e930

Browse files
committed
[INFRA] Bump CMake
CPP23 detection needs 3.20, 3.10 and older will also be deprecated
1 parent a979480 commit 5c1e930

File tree

19 files changed

+51
-85
lines changed

19 files changed

+51
-85
lines changed

CMakeLists.txt

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,18 @@
66
# SeqAn3. To build tests, run cmake on one of the sub-folders in this directory
77
# which contain a CMakeLists.txt.
88

9-
cmake_minimum_required (VERSION 3.5...3.30)
9+
cmake_minimum_required (VERSION 3.20...3.31)
1010

1111
find_path (SEQAN3_MODULE_PATH "seqan3-config.cmake" HINTS "${CMAKE_CURRENT_LIST_DIR}/cmake/")
1212
list (APPEND CMAKE_MODULE_PATH "${SEQAN3_MODULE_PATH}")
1313

1414
include (seqan3-config-version)
1515

16-
if (CMAKE_VERSION VERSION_LESS 3.12)
17-
project (seqan3
18-
LANGUAGES CXX
19-
VERSION "${SEQAN3_PROJECT_VERSION}")
20-
else ()
21-
project (seqan3
22-
LANGUAGES CXX
23-
VERSION "${SEQAN3_PROJECT_VERSION}"
24-
DESCRIPTION "SeqAn3 -- the modern C++ library for sequence analysis" # since cmake 3.9
25-
HOMEPAGE_URL "https://github.com/seqan/seqan3" # since cmake 3.12
26-
)
27-
endif ()
16+
project (seqan3
17+
LANGUAGES CXX
18+
VERSION "${SEQAN3_PROJECT_VERSION}"
19+
DESCRIPTION "SeqAn3 -- the modern C++ library for sequence analysis"
20+
HOMEPAGE_URL "https://github.com/seqan/seqan3")
2821

2922
find_package (SeqAn3 3.0 REQUIRED HINTS ${SEQAN3_MODULE_PATH})
3023

doc/setup/quickstart_cmake/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ For example, after adding `another_program.cpp` your `CMakeLists.txt` may look l
188188
# Including SeqAn3 as external project
189189

190190
```cmake
191-
cmake_minimum_required (VERSION 3.14...3.30)
191+
cmake_minimum_required (VERSION 3.20...3.31)
192192
193193
project (my_app LANGUAGES CXX VERSION 1.0.0)
194194

test/analyse/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
33
# SPDX-License-Identifier: BSD-3-Clause
44

5-
cmake_minimum_required (VERSION 3.10...3.30)
5+
cmake_minimum_required (VERSION 3.20...3.31)
66
project (seqan3_test_analyze CXX)
77

88
include (../seqan3-test.cmake)

test/api_stability/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
33
# SPDX-License-Identifier: CC0-1.0
44

5-
cmake_minimum_required (VERSION 3.8...3.30)
5+
cmake_minimum_required (VERSION 3.20...3.31)
66

77
project (api_stability)
88

test/coverage/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
33
# SPDX-License-Identifier: BSD-3-Clause
44

5-
cmake_minimum_required (VERSION 3.10...3.30)
5+
cmake_minimum_required (VERSION 3.20...3.31)
66
project (seqan3_test_coverage CXX)
77

88
# Add a custom build type: Coverage

test/documentation/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: BSD-3-Clause
44

55
# Minimum cmake version
6-
cmake_minimum_required (VERSION 3.7...3.30)
6+
cmake_minimum_required (VERSION 3.20...3.31)
77

88
### Find seqan3
99
include (../../cmake/seqan3-config-version.cmake)

test/external_project/CMakeLists.txt

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22
# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
33
# SPDX-License-Identifier: BSD-3-Clause
44

5-
cmake_minimum_required (VERSION 3.5...3.30)
5+
cmake_minimum_required (VERSION 3.20...3.31)
66
project (seqan3_test_external_project CXX)
77

88
include (../seqan3-test.cmake) # for SEQAN3_EXTERNAL_PROJECT_CMAKE_ARGS, SEQAN3_VERSION
99
include (ExternalProject)
1010

1111
set (SEQAN3_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../")
1212

13-
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.14) # cmake 3.14 version is needed to install seqan3.
14-
include (install-seqan3.cmake)
15-
include (install-sharg.cmake)
16-
endif ()
13+
include (install-seqan3.cmake)
14+
include (install-sharg.cmake)
1715

1816
option (SEQAN3_EXTERNAL_PROJECT_FIND_DEBUG_MODE
1917
"Enable this option if you want to get a detailed list which paths were considered for find_package(...)" false)
@@ -72,16 +70,14 @@ ExternalProject_Add (
7270
# We need CMake >= 3.14 to be able to package seqan3, but we actually expect that this
7371
# test works with CMake >= 3.5.
7472
# (ExternalProject_Add simulates a fresh and separate invocation of cmake ../)
75-
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.14) # cmake 3.14 version is needed to install seqan3.
76-
ExternalProject_Add (
77-
seqan3_installed
78-
PREFIX seqan3_installed
79-
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/seqan3_installed"
80-
CMAKE_ARGS ${SEQAN3_EXTERNAL_PROJECT_CMAKE_ARGS}
81-
"-DCMAKE_FIND_DEBUG_MODE=${SEQAN3_EXTERNAL_PROJECT_FIND_DEBUG_MODE}"
82-
"-DCMAKE_SYSTEM_PREFIX_PATH=${SEQAN3_SYSTEM_PREFIX}")
83-
add_dependencies (seqan3_installed seqan3_test_prerequisite)
84-
endif ()
73+
ExternalProject_Add (
74+
seqan3_installed
75+
PREFIX seqan3_installed
76+
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/seqan3_installed"
77+
CMAKE_ARGS ${SEQAN3_EXTERNAL_PROJECT_CMAKE_ARGS}
78+
"-DCMAKE_FIND_DEBUG_MODE=${SEQAN3_EXTERNAL_PROJECT_FIND_DEBUG_MODE}"
79+
"-DCMAKE_SYSTEM_PREFIX_PATH=${SEQAN3_SYSTEM_PREFIX}")
80+
add_dependencies (seqan3_installed seqan3_test_prerequisite)
8581

8682
# 4) This tests test/external_project/seqan3_fetch_content_zip/CMakeLists.txt
8783
# It uses fetch_content (a CMake 3.14 feature) to download our zip-release (e.g. zip, tar.xz) from
@@ -90,16 +86,14 @@ endif ()
9086
# Note that FetchContent is a CMake >= 3.14 feature.
9187
# This is expected to work with CMake >= 3.14.
9288
# (ExternalProject_Add simulates a fresh and separate invocation of cmake ../)
93-
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.14) # cmake 3.14 version is needed to use fetch_content.
94-
ExternalProject_Add (
95-
seqan3_fetch_content_zip
96-
PREFIX seqan3_fetch_content_zip
97-
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/seqan3_fetch_content_zip"
98-
CMAKE_ARGS ${SEQAN3_EXTERNAL_PROJECT_CMAKE_ARGS}
99-
"-DCMAKE_FIND_DEBUG_MODE=${SEQAN3_EXTERNAL_PROJECT_FIND_DEBUG_MODE}"
100-
"-DSEQAN3_PACKAGE_ZIP_URL=${SEQAN3_PACKAGE_ZIP_URL}")
101-
add_dependencies (seqan3_fetch_content_zip seqan3_test_prerequisite)
102-
endif ()
89+
ExternalProject_Add (
90+
seqan3_fetch_content_zip
91+
PREFIX seqan3_fetch_content_zip
92+
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/seqan3_fetch_content_zip"
93+
CMAKE_ARGS ${SEQAN3_EXTERNAL_PROJECT_CMAKE_ARGS}
94+
"-DCMAKE_FIND_DEBUG_MODE=${SEQAN3_EXTERNAL_PROJECT_FIND_DEBUG_MODE}"
95+
"-DSEQAN3_PACKAGE_ZIP_URL=${SEQAN3_PACKAGE_ZIP_URL}")
96+
add_dependencies (seqan3_fetch_content_zip seqan3_test_prerequisite)
10397

10498
# 5) This test is the same as 2) but emulates the settings within the setup tutorial.
10599
# This test is used as snippet in the setup tutorial.

test/external_project/seqan3_fetch_content_zip/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
33
# SPDX-License-Identifier: BSD-3-Clause
44

5-
cmake_minimum_required (VERSION 3.14...3.30)
5+
cmake_minimum_required (VERSION 3.20...3.31)
66
project (seqan3_app CXX)
77

88
# --- helper scripts

test/external_project/seqan3_installed/CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
33
# SPDX-License-Identifier: BSD-3-Clause
44

5-
cmake_minimum_required (VERSION 3.5...3.30)
5+
cmake_minimum_required (VERSION 3.20...3.31)
66
project (seqan3_app CXX)
77

88
# --- helper scripts
@@ -15,8 +15,5 @@ find_package (seqan3 3.0 REQUIRED)
1515
# build app with seqan3
1616
add_executable (hello_world ../src/hello_world.cpp)
1717
target_link_libraries (hello_world seqan3::seqan3)
18-
if (CMAKE_VERSION VERSION_LESS 3.14)
19-
install (TARGETS hello_world RUNTIME DESTINATION bin)
20-
else ()
21-
install (TARGETS hello_world) # RUNTIME DESTINATION not needed anymore since cmake 3.14
22-
endif ()
18+
19+
install (TARGETS hello_world)

test/external_project/seqan3_setup_tutorial/CMakeLists.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ file (COPY "${CMAKE_SOURCE_DIR}/../src/hello_world.cpp" DESTINATION "${CMAKE_CUR
1414
set (CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../../source")
1515

1616
## [adding_files]
17-
cmake_minimum_required (VERSION 3.5...3.30)
17+
cmake_minimum_required (VERSION 3.20...3.31)
1818
project (seqan3_tutorial CXX)
1919

2020
# add seqan3 to search path
@@ -31,8 +31,4 @@ add_executable (another_program another_program.cpp)
3131
target_link_libraries (another_program seqan3::seqan3)
3232
## [adding_files]
3333

34-
if (CMAKE_VERSION VERSION_LESS 3.14)
35-
install (TARGETS hello_world another_program RUNTIME DESTINATION bin)
36-
else ()
37-
install (TARGETS hello_world another_program) # RUNTIME DESTINATION not needed anymore since cmake 3.14
38-
endif ()
34+
install (TARGETS hello_world another_program)

0 commit comments

Comments
 (0)