Skip to content

Commit

Permalink
[INFRA] Bump minimal CMake version
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Jan 22, 2024
1 parent 646b6a2 commit 1676a53
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 32 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ If possible, provide tooling that performs the changes, e.g. a shell-script.

#### Dependencies
* We now use Doxygen version 1.9.8 to build our documentation ([\#3197](https://github.com/seqan/seqan3/pull/3197)).
* We bumped the minimal CMake version to 3.5 ([\#3223](https://github.com/seqan/seqan3/pull/3223)).

# 3.3.0

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# SeqAn3. To build tests, run cmake on one of the sub-folders in this directory
# which contain a CMakeLists.txt.

cmake_minimum_required (VERSION 3.4)
cmake_minimum_required (VERSION 3.5)

find_path (SEQAN3_MODULE_PATH "seqan3-config.cmake" HINTS "${CMAKE_CURRENT_LIST_DIR}/build_system/")
list (APPEND CMAKE_MODULE_PATH "${SEQAN3_MODULE_PATH}")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Please see the [online documentation](https://docs.seqan.de/seqan/3-master-user/
| | requirement | version | comment |
|-------------------|------------------------------------------------------|----------|---------------------------------------------|
|**compiler** | [GCC](https://gcc.gnu.org) | ≥ 11 | no other compiler is currently supported! |
|**build system** | [CMake](https://cmake.org) | ≥ 3.4 | optional, but recommended |
|**build system** | [CMake](https://cmake.org) | ≥ 3.5 | optional, but recommended |
|**required libs** | [SDSL](https://github.com/xxsds/sdsl-lite) | ≥ 3.0.3 | |
|**optional libs** | [cereal](https://github.com/USCiLab/cereal) | ≥ 1.3.1 | required for serialisation and CTD support |
| | [zlib](https://github.com/madler/zlib) | ≥ 1.2 | required for `*.gz` and `.bam` file support |
Expand Down
2 changes: 1 addition & 1 deletion build_system/seqan3-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#
# ============================================================================

cmake_minimum_required (VERSION 3.4...3.12)
cmake_minimum_required (VERSION 3.5...3.12)

# ----------------------------------------------------------------------------
# Set initial variables
Expand Down
2 changes: 1 addition & 1 deletion doc/setup/quickstart_cmake/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ works.
# Software
Requirements:
- gcc >= 11
- cmake >= 3.4
- cmake >= 3.5
- git

## Installing GCC
Expand Down
20 changes: 10 additions & 10 deletions test/external_project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
# -----------------------------------------------------------------------------------------------------

cmake_minimum_required (VERSION 3.4)
cmake_minimum_required (VERSION 3.5)
project (seqan3_test_external_project CXX)

include (../seqan3-test.cmake) # for SEQAN3_EXTERNAL_PROJECT_CMAKE_ARGS, SEQAN3_VERSION
Expand All @@ -21,9 +21,9 @@ endif ()
option (SEQAN3_EXTERNAL_PROJECT_FIND_DEBUG_MODE
"Enable this option if you want to get a detailed list which paths were considered for find_package(...)" false)

if (NOT ${CMAKE_VERSION} VERSION_LESS 3.14) # cmake 3.14 version is needed to install cmake 3.4.
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.14) # cmake 3.14 version is needed to install cmake 3.5.
set (SEQAN3_EXTERNAL_PROJECT_CMAKE_COMMAND "${CMAKE_COMMAND}")
include (use-cmake3.4.cmake) # ensure that seqan3 can be used with cmake 3.4
include (use-cmake3.5.cmake) # ensure that seqan3 can be used with cmake 3.5
else ()
set (SEQAN3_EXTERNAL_PROJECT_CMAKE_COMMAND "${CMAKE_COMMAND}")
endif ()
Expand All @@ -39,16 +39,16 @@ endif ()
# fetch_content
#
# If your current CMake version is >= 3.14, we
# * download CMake 3.4
# * test test/external_project/seqan3_submodule_add_subdirectory/CMakeLists.txt with CMake 3.4
# * test test/external_project/seqan3_submodule_find_package/CMakeLists.txt with CMake 3.4
# * test test/external_project/seqan3_installed/CMakeLists.txt with CMake 3.4
# * download CMake 3.5
# * test test/external_project/seqan3_submodule_add_subdirectory/CMakeLists.txt with CMake 3.5
# * test test/external_project/seqan3_submodule_find_package/CMakeLists.txt with CMake 3.5
# * test test/external_project/seqan3_installed/CMakeLists.txt with CMake 3.5
# * test test/external_project/seqan3_fetch_content_zip/CMakeLists.txt with your current CMake version

# 1) This tests test/external_project/seqan3_submodule_add_subdirectory/CMakeLists.txt
# That means we use add_subdirectory directly on seqan3's top level CMakeLists.txt.
# This will automatically call find_package and expose our seqan3::seqan3 target.
# This is expected to work with CMake >= 3.4.
# This is expected to work with CMake >= 3.5.
# (ExternalProject_Add simulates a fresh and separate invocation of cmake ../)
ExternalProject_Add (
seqan3_submodule_add_subdirectory
Expand All @@ -62,7 +62,7 @@ ExternalProject_Add (
# 2) This tests test/external_project/seqan3_submodule_find_package/CMakeLists.txt
# We have a seqan3 checkout somewhere and we point CMAKE_PREFIX_PATH to <checkout>/seqan3/build_system
# and then use `find_package` to find `seqan3-config.cmake` which exposes our `seqan3::seqan3` target.
# This is expected to work with CMake >= 3.4.
# This is expected to work with CMake >= 3.5.
# (ExternalProject_Add simulates a fresh and separate invocation of cmake ../)
ExternalProject_Add (
seqan3_submodule_find_package
Expand All @@ -82,7 +82,7 @@ ExternalProject_Add (
# https://github.com/seqan/seqan3/releases, and unzipping it to some folder and making
# that path globally accessible by CMAKE_SYSTEM_PREFIX_PATH.
# We need CMake >= 3.14 to be able to package seqan3, but we actually expect that this
# test works with CMake >= 3.4.
# test works with CMake >= 3.5.
# (ExternalProject_Add simulates a fresh and separate invocation of cmake ../)
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.14) # cmake 3.14 version is needed to install seqan3.
ExternalProject_Add (
Expand Down
2 changes: 1 addition & 1 deletion test/external_project/seqan3_installed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
# -----------------------------------------------------------------------------------------------------

cmake_minimum_required (VERSION 3.4)
cmake_minimum_required (VERSION 3.5)
project (seqan3_app CXX)

# --- helper scripts
Expand Down
2 changes: 1 addition & 1 deletion test/external_project/seqan3_setup_tutorial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ file (COPY "${CMAKE_SOURCE_DIR}/../src/hello_world.cpp" DESTINATION "${CMAKE_CUR
set (CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../../source")

## [adding_files]
cmake_minimum_required (VERSION 3.4)
cmake_minimum_required (VERSION 3.5)
project (seqan3_tutorial CXX)

# add seqan3 to search path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set (CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../../source")
list (APPEND CMAKE_PREFIX_PATH "${SHARG_ROOT}/build_system")

## [adding_files]
cmake_minimum_required (VERSION 3.4)
cmake_minimum_required (VERSION 3.5)
project (seqan3_tutorial CXX)

# add seqan3 to search path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
# -----------------------------------------------------------------------------------------------------

cmake_minimum_required (VERSION 3.4)
cmake_minimum_required (VERSION 3.5)
project (seqan3_app CXX)

# --- helper scripts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
# -----------------------------------------------------------------------------------------------------

cmake_minimum_required (VERSION 3.4)
cmake_minimum_required (VERSION 3.5)
project (seqan3_app CXX)

# --- helper scripts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
# -----------------------------------------------------------------------------------------------------

cmake_minimum_required (VERSION 3.4)
cmake_minimum_required (VERSION 3.5)
project (seqan3_app CXX)

# --- helper scripts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ project (seqan3_test_seqan3_config CXX)

# require Linux and x86_64
if (NOT (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SIZEOF_VOID_P EQUAL 8))
message (STATUS "cmake 3.4 test requires Linux and x86_64")
message (STATUS "cmake 3.5 test requires Linux and x86_64")
return ()
endif ()

include (FetchContent)
FetchContent_Declare (
cmake34
URL "https://github.com/Kitware/CMake/releases/download/v3.4.3/cmake-3.4.3-Linux-x86_64.tar.gz"
cmake35
URL "https://github.com/Kitware/CMake/releases/download/v3.5.2/cmake-3.5.2-Linux-x86_64.tar.gz"
URL_HASH "SHA256=66b8d315c852908be9f79e1a18b8778714659fce4ddb2d041af8680a239202fc")
FetchContent_MakeAvailable (cmake34)
FetchContent_MakeAvailable (cmake35)

set (cmake34_command "${cmake34_SOURCE_DIR}/bin/cmake")
set (cmake35_command "${cmake35_SOURCE_DIR}/bin/cmake")

execute_process (COMMAND ${cmake34_command} --version
RESULT_VARIABLE cmake34_result
OUTPUT_VARIABLE cmake34_output)
execute_process (COMMAND ${cmake35_command} --version
RESULT_VARIABLE cmake35_result
OUTPUT_VARIABLE cmake35_output)

if ("${cmake34_result}" STREQUAL "0" AND cmake34_output MATCHES "cmake version 3.4.3")
set (SEQAN3_EXTERNAL_PROJECT_CMAKE_COMMAND "${cmake34_command}")
message (STATUS "Use cmake3.4 in tests [${cmake34_command}]")
if ("${cmake35_result}" STREQUAL "0" AND cmake35_output MATCHES "cmake version 3.5.2")
set (SEQAN3_EXTERNAL_PROJECT_CMAKE_COMMAND "${cmake35_command}")
message (STATUS "Use cmake3.5 in tests [${cmake35_command}]")
else ()
message (AUTHOR_WARNING "Couldn't execute cmake3.4 --version [${cmake34_command}]")
message (AUTHOR_WARNING "Couldn't execute cmake3.5 --version [${cmake35_command}]")
endif ()

0 comments on commit 1676a53

Please sign in to comment.