Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/Detray/extern/benchmark/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # This file is part of the ACTS project.
0002 #
0003 # Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 #
0005 # This Source Code Form is subject to the terms of the Mozilla Public
0006 # License, v. 2.0. If a copy of the MPL was not distributed with this
0007 # file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 # CMake include(s).
0010 cmake_minimum_required(VERSION 3.11)
0011 include(FetchContent)
0012 
0013 # Silence FetchContent warnings with CMake >=3.24.
0014 if(POLICY CMP0135)
0015     cmake_policy(SET CMP0135 NEW)
0016 endif()
0017 
0018 # Tell the user what's happening.
0019 message(STATUS "Building Google Benchmark as part of the Detray project")
0020 
0021 # Declare where to get Google Benchmark from.
0022 set(DETRAY_BENCHMARK_SOURCE
0023     "URL;https://github.com/google/benchmark/archive/refs/tags/v${DETRAY_BENCHMARK_VERSION}.tar.gz;URL_MD5;${DETRAY_BENCHMARK_DIGEST}"
0024     CACHE STRING
0025     "Source for Google Benchmark, when built as part of this project"
0026 )
0027 mark_as_advanced(DETRAY_BENCHMARK_SOURCE)
0028 
0029 # Mark the import as a system library on modern CMake versions
0030 if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.25.0)
0031     set(DETRAY_BENCHMARK_SOURCE_FULL "${DETRAY_BENCHMARK_SOURCE};SYSTEM")
0032 else()
0033     set(DETRAY_BENCHMARK_SOURCE_FULL "${DETRAY_BENCHMARK_SOURCE}")
0034 endif()
0035 mark_as_advanced(DETRAY_BENCHMARK_SOURCE_FULL)
0036 
0037 FetchContent_Declare(Benchmark ${DETRAY_BENCHMARK_SOURCE_FULL})
0038 
0039 # Options used in the build of Google Benchmark.
0040 set(BENCHMARK_ENABLE_TESTING
0041     OFF
0042     CACHE BOOL
0043     "Turn off the tests in Google Benchmark"
0044 )
0045 set(BENCHMARK_ENABLE_WERROR
0046     OFF
0047     CACHE BOOL
0048     "Turn off the -Werror for Release build"
0049 )
0050 
0051 # Get it into the current directory.
0052 FetchContent_MakeAvailable(Benchmark)
0053 
0054 # Set up an alias for the Google Benchmark target with the same name that it
0055 # has when we find it pre-installed.
0056 add_library(benchmark::benchmark ALIAS benchmark)