From 8bc790de2d5801249bb47debea011707f06b49b3 Mon Sep 17 00:00:00 2001 From: Attila Krasznahorkay Date: Fri, 9 Aug 2024 10:45:01 +0200 Subject: [PATCH] Slight updates to the externals. CMake 3.30.X was taught to configure the code without warnings. Introduced VECMEM_GOOGLETEST_SOURCE and VECMEM_BENCHMARK_SOURCE to allow client code to override the version of these externals used by the project. Updated the version of GoogleTest to the current latest one. --- benchmarks/googlebenchmark/CMakeLists.txt | 13 +++++++++---- tests/googletest/CMakeLists.txt | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/benchmarks/googlebenchmark/CMakeLists.txt b/benchmarks/googlebenchmark/CMakeLists.txt index a8179b80..05b7ec0a 100644 --- a/benchmarks/googlebenchmark/CMakeLists.txt +++ b/benchmarks/googlebenchmark/CMakeLists.txt @@ -8,18 +8,23 @@ cmake_minimum_required( VERSION 3.11 ) include( FetchContent ) -# Silence FetchContent warnings with CMake >=3.24. +# Silence various FetchContent warnings up to CMake 3.30.X. if( POLICY CMP0135 ) cmake_policy( SET CMP0135 NEW ) endif() +if( POLICY CMP0169 ) + cmake_policy( SET CMP0169 OLD ) +endif() # Tell the user what's happening. message( STATUS "Building Google Benchmark as part of the VecMem project" ) # Declare where to get googlebenchmark from. -FetchContent_Declare( googlebenchmark - URL "https://github.com/google/benchmark/archive/refs/tags/v1.6.1.tar.gz" - URL_MD5 "8c33c51f9b7154e6c290df3750081c87" ) +set( VECMEM_BENCHMARK_SOURCE + "URL;https://github.com/google/benchmark/archive/refs/tags/v1.6.1.tar.gz;URL_MD5;8c33c51f9b7154e6c290df3750081c87" + CACHE STRING "Source for GoogleBenchmark, when built as part of VecMem" ) +mark_as_advanced( VECMEM_BENCHMARK_SOURCE ) +FetchContent_Declare( googlebenchmark ${VECMEM_BENCHMARK_SOURCE} ) # Option(s) used in the build of Google Benchmark. set( BENCHMARK_ENABLE_TESTING OFF CACHE BOOL diff --git a/tests/googletest/CMakeLists.txt b/tests/googletest/CMakeLists.txt index 552a7c0f..618b930d 100644 --- a/tests/googletest/CMakeLists.txt +++ b/tests/googletest/CMakeLists.txt @@ -8,18 +8,23 @@ cmake_minimum_required( VERSION 3.11 ) include( FetchContent ) -# Silence FetchContent warnings with CMake >=3.24. +# Silence various FetchContent warnings up to CMake 3.30.X. if( POLICY CMP0135 ) cmake_policy( SET CMP0135 NEW ) endif() +if( POLICY CMP0169 ) + cmake_policy( SET CMP0169 OLD ) +endif() # Tell the user what's happening. message( STATUS "Building GoogleTest as part of the VecMem project" ) # Declare where to get GoogleTest from. -FetchContent_Declare( GoogleTest - URL "https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz" - URL_MD5 "c8340a482851ef6a3fe618a082304cfc" ) +set( VECMEM_GOOGLETEST_SOURCE + "URL;https://github.com/google/googletest/archive/refs/tags/v1.15.2.tar.gz;URL_MD5;7e11f6cfcf6498324ac82d567dcb891e" + CACHE STRING "Source for GoogleTest, when built as part of VecMem" ) +mark_as_advanced( VECMEM_GOOGLETEST_SOURCE ) +FetchContent_Declare( GoogleTest ${VECMEM_GOOGLETEST_SOURCE} ) # Options used in the build of GoogleTest. set( BUILD_GMOCK FALSE CACHE BOOL "Turn off the build of GMock" )