Skip to content

Commit

Permalink
[INFRA] Make datasources quiet
Browse files Browse the repository at this point in the history
Use FetchContent, CMake 3.30 makes FetchContent quiet by default: https://cmake.org/cmake/help/latest/policy/CMP0168.html
  • Loading branch information
eseiler committed Sep 27, 2024
1 parent dbd2e83 commit 8a9c710
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
23 changes: 9 additions & 14 deletions cmake/test/declare_datasource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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:
#
Expand Down Expand Up @@ -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 <DOWNLOADED_FILE>
${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}")
Expand Down
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8a9c710

Please sign in to comment.