Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/Detray/extern/vc/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.14)
0011 include(FetchContent)
0012 
0013 # Tell the user what's happening.
0014 message(STATUS "Building Vc as part of the Detray project")
0015 
0016 # Declare where to get Vc from.
0017 set(DETRAY_VC_SOURCE
0018     "URL;https://github.com/VcDevel/Vc/archive/refs/tags/${DETRAY_VC_VERSION}.tar.gz;URL_MD5;${DETRAY_VC_DIGEST}"
0019     CACHE STRING
0020     "Source for Vc, when built as part of this project"
0021 )
0022 mark_as_advanced(DETRAY_VC_SOURCE)
0023 
0024 # Mark the import as a system library on modern CMake versions
0025 if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.25.0)
0026     set(DETRAY_VC_SOURCE_FULL "${DETRAY_VC_SOURCE};SYSTEM")
0027 else()
0028     set(DETRAY_VC_SOURCE_FULL "${DETRAY_VC_SOURCE}")
0029 endif()
0030 mark_as_advanced(DETRAY_VC_SOURCE_FULL)
0031 
0032 FetchContent_Declare(Vc ${DETRAY_VC_SOURCE_FULL})
0033 
0034 # Turn off the unit tests for Vc.
0035 if(DEFINED CACHE{BUILD_TESTING})
0036     set(_buildTestingValue ${BUILD_TESTING})
0037 endif()
0038 set(BUILD_TESTING FALSE CACHE INTERNAL "Forceful setting of BUILD_TESTING")
0039 
0040 # Get it into the current directory.
0041 FetchContent_MakeAvailable(Vc)
0042 
0043 # Reset the BUILD_TESTING variable.
0044 if(DEFINED _buildTestingValue)
0045     set(BUILD_TESTING
0046         ${_buildTestingValue}
0047         CACHE BOOL
0048         "Turn tests on/off"
0049         FORCE
0050     )
0051     unset(_buildTestingValue)
0052 else()
0053     unset(BUILD_TESTING CACHE)
0054 endif()
0055 
0056 # Treat the Vc headers as "system headers", to avoid getting warnings from them.
0057 target_include_directories(
0058     Vc
0059     SYSTEM
0060     INTERFACE $<TARGET_PROPERTY:Vc,INCLUDE_DIRECTORIES>
0061 )
0062 
0063 # Disable a warning for GCC which the Vc build turns on explicitly for that
0064 # compiler, just to then go and trigger it... :-/
0065 if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
0066     target_compile_options(
0067         Vc
0068         PRIVATE "-Wno-old-style-cast -Wno-deprecated-enum-enum-conversion"
0069     )
0070 endif()
0071 
0072 # Set up an alias for the Vc target, with the same name that it will have
0073 # when "finding it".
0074 add_library(Vc::Vc ALIAS Vc)