From 8a9c7107306d168f421572e13ba364c881578499 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 27 Sep 2024 13:29:53 +0200 Subject: [PATCH] [INFRA] Make datasources quiet Use FetchContent, CMake 3.30 makes FetchContent quiet by default: https://cmake.org/cmake/help/latest/policy/CMP0168.html --- CMakeLists.txt | 2 +- cmake/test/declare_datasource.cmake | 23 +++++++++-------------- doc/CMakeLists.txt | 2 +- src/CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- test/api/CMakeLists.txt | 2 +- test/cli/CMakeLists.txt | 2 +- 7 files changed, 15 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37bf56a..142dad4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.25) +cmake_minimum_required (VERSION 3.25...3.30) # Define the application name and version. project (needle diff --git a/cmake/test/declare_datasource.cmake b/cmake/test/declare_datasource.cmake index 7955c4b..a7a236d 100644 --- a/cmake/test/declare_datasource.cmake +++ b/cmake/test/declare_datasource.cmake @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik # SPDX-License-Identifier: CC0-1.0 -include (ExternalProject) +include (FetchContent) # Example call: # @@ -50,19 +50,14 @@ function (declare_datasource) # create data folder file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data) - ExternalProject_Add ("${datasource_name}" - URL "${ARG_URL}" - URL_HASH "${ARG_URL_HASH}" - DOWNLOAD_NAME "${ARG_FILE}" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND ${CMAKE_COMMAND} -E create_symlink - ${CMAKE_CURRENT_BINARY_DIR}/data/${ARG_FILE} - TEST_COMMAND "" - PREFIX "${CMAKE_CURRENT_BINARY_DIR}/_datasources" - DOWNLOAD_NO_EXTRACT TRUE # don't extract archive files like .tar.gz. - EXCLUDE_FROM_ALL TRUE - ${ARG_UNPARSED_ARGUMENTS} + FetchContent_Populate ("${datasource_name}" + URL "${ARG_URL}" + URL_HASH "${ARG_URL_HASH}" + DOWNLOAD_NAME "${ARG_FILE}" + DOWNLOAD_NO_EXTRACT TRUE # don't extract archive files like .tar.gz. + SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/data/" + BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/data/" + EXCLUDE_FROM_ALL TRUE ${ARG_UNPARSED_ARGUMENTS} ) add_dependencies (${PROJECT_NAME}_test "${datasource_name}") diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index fec0d08..2d660ad 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.25) +cmake_minimum_required (VERSION 3.25...3.30) # Find doxygen. find_package (Doxygen 1.9.4 QUIET) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 517f7ca..b9357d1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.25) +cmake_minimum_required (VERSION 3.25...3.30) find_package (OpenMP REQUIRED COMPONENTS CXX) add_library ("${PROJECT_NAME}_lib" STATIC estimate.cpp ibf.cpp) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2b1048c..aedd0dd 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik # SPDX-License-Identifier: CC0-1.0 -cmake_minimum_required (VERSION 3.25) +cmake_minimum_required (VERSION 3.25...3.30) # This includes `cmake/test/config.cmake` which takes care of setting up the test infrastructure. It also provides # the `add_app_test` macro, which is used to add tests to the CMake test suite. diff --git a/test/api/CMakeLists.txt b/test/api/CMakeLists.txt index 105e00b..26aea24 100644 --- a/test/api/CMakeLists.txt +++ b/test/api/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik # SPDX-License-Identifier: CC0-1.0 -cmake_minimum_required (VERSION 3.25) +cmake_minimum_required (VERSION 3.25...3.30) add_app_test (count_test.cpp) add_app_test (insert_delete_test.cpp) diff --git a/test/cli/CMakeLists.txt b/test/cli/CMakeLists.txt index 8c984d1..ca75ed5 100644 --- a/test/cli/CMakeLists.txt +++ b/test/cli/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik # SPDX-License-Identifier: CC0-1.0 -cmake_minimum_required (VERSION 3.25) +cmake_minimum_required (VERSION 3.25...3.30) add_app_test (needle_options_test.cpp) add_app_test (ibf_options_test.cpp)