diff --git a/.github/workflows/cron_latest_libraries.yml b/.github/workflows/cron_latest_libraries.yml index a3412c754e..697f07b0d6 100644 --- a/.github/workflows/cron_latest_libraries.yml +++ b/.github/workflows/cron_latest_libraries.yml @@ -52,15 +52,15 @@ jobs: - name: Update googletest run: | - grep 'gtest_git_tag ".*"' seqan3/test/cmake/seqan3_require_test.cmake - sed -i 's/gtest_git_tag ".*"/gtest_git_tag "main"/' seqan3/test/cmake/seqan3_require_test.cmake - grep 'gtest_git_tag ".*"' seqan3/test/cmake/seqan3_require_test.cmake + grep 'SEQAN3_GTEST_TAG ".*"' seqan3/test/cmake/seqan3_require_test.cmake + sed -i 's/SEQAN3_GTEST_TAG ".*"/SEQAN3_GTEST_TAG "main"/' seqan3/test/cmake/seqan3_require_test.cmake + grep 'SEQAN3_GTEST_TAG ".*"' seqan3/test/cmake/seqan3_require_test.cmake - name: Update googlebenchmark run: | - grep 'gbenchmark_git_tag ".*"' seqan3/test/cmake/seqan3_require_benchmark.cmake - sed -i 's/gbenchmark_git_tag ".*"/gbenchmark_git_tag "main"/' seqan3/test/cmake/seqan3_require_benchmark.cmake - grep 'gbenchmark_git_tag ".*"' seqan3/test/cmake/seqan3_require_benchmark.cmake + grep 'SEQAN3_BENCHMARK_TAG ".*"' seqan3/test/cmake/seqan3_require_benchmark.cmake + sed -i 's/SEQAN3_BENCHMARK_TAG ".*"/SEQAN3_BENCHMARK_TAG "main"/' seqan3/test/cmake/seqan3_require_benchmark.cmake + grep 'SEQAN3_BENCHMARK_TAG ".*"' seqan3/test/cmake/seqan3_require_benchmark.cmake - name: Checkout SeqAn2 uses: actions/checkout@v3 diff --git a/test/cmake/seqan3_require_benchmark.cmake b/test/cmake/seqan3_require_benchmark.cmake index 87d001698b..82d7527f18 100644 --- a/test/cmake/seqan3_require_benchmark.cmake +++ b/test/cmake/seqan3_require_benchmark.cmake @@ -12,25 +12,25 @@ cmake_minimum_required (VERSION 3.16) macro (seqan3_require_benchmark) enable_testing () - set (benchmark_version "1.8.2") - set (gbenchmark_git_tag "v${benchmark_version}") + set (SEQAN3_BENCHMARK_TAG "v1.8.2") - find_package (benchmark ${benchmark_version} EXACT QUIET) + find_package (benchmark QUIET) - if (NOT benchmark_FOUND) - message (STATUS "Fetching Google Benchmark ${benchmark_version}") + # Also ensure that Google Benchmark if fetched for the latest library cron, which sets the tag to "main". + if (NOT benchmark_FOUND OR "${SEQAN3_BENCHMARK_TAG}" STREQUAL "main") + message (STATUS "Fetching Google Benchmark ${SEQAN3_BENCHMARK_TAG}") include (FetchContent) FetchContent_Declare ( gbenchmark_fetch_content GIT_REPOSITORY "https://github.com/google/benchmark.git" - GIT_TAG "${gbenchmark_git_tag}") + GIT_TAG "${SEQAN3_BENCHMARK_TAG}") option (BENCHMARK_ENABLE_TESTING "" OFF) option (BENCHMARK_ENABLE_WERROR "" OFF) # Does not apply to Debug builds. option (BENCHMARK_ENABLE_INSTALL "" OFF) FetchContent_MakeAvailable (gbenchmark_fetch_content) else () - message (STATUS "Found Google Benchmark ${benchmark_version}") + message (STATUS " Test dependency: Google Benchmark ${benchmark_VERSION} found.") endif () # NOTE: google benchmark's CMakeLists.txt already defines Shlwapi diff --git a/test/cmake/seqan3_require_test.cmake b/test/cmake/seqan3_require_test.cmake index 102d3cc6fc..c91f65d4d5 100644 --- a/test/cmake/seqan3_require_test.cmake +++ b/test/cmake/seqan3_require_test.cmake @@ -12,24 +12,24 @@ cmake_minimum_required (VERSION 3.16) macro (seqan3_require_test) enable_testing () - set (gtest_version "1.13.0") - set (gtest_git_tag "v${gtest_version}") + set (SEQAN3_GTEST_TAG "v1.13.0") - find_package (GTest ${gtest_version} EXACT QUIET) + find_package (GTest QUIET) - if (NOT GTest_FOUND) - message (STATUS "Fetching Google Test ${gtest_version}") + # Also ensure that Google Test if fetched for the latest library cron, which sets the tag to "main". + if (NOT GTest_FOUND OR "${SEQAN3_GTEST_TAG}" STREQUAL "main") + message (STATUS "Fetching Google Test ${SEQAN3_GTEST_TAG}") include (FetchContent) FetchContent_Declare ( gtest_fetch_content GIT_REPOSITORY "https://github.com/google/googletest.git" - GIT_TAG "${gtest_git_tag}") + GIT_TAG "${SEQAN3_GTEST_TAG}") option (BUILD_GMOCK "" OFF) option (INSTALL_GTEST "" OFF) FetchContent_MakeAvailable (gtest_fetch_content) else () - message (STATUS "Found Google Test ${gtest_version}") + message (STATUS " Test dependency: Google Test ${GTest_VERSION} found.") endif () if (NOT TARGET gtest_build)