Warning, /acts/Detray/extern/eigen3/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 Eigen3 as part of the Detray project")
0015
0016 # Declare where to get Eigen3 from.
0017 set(DETRAY_EIGEN_SOURCE
0018 "URL;https://gitlab.com/libeigen/eigen/-/archive/${DETRAY_EIGEN_VERSION}/eigen-${DETRAY_EIGEN_VERSION}.tar.bz2;URL_MD5;${DETRAY_EIGEN_DIGEST}"
0019 CACHE STRING
0020 "Source for Eigen, when built as part of this project"
0021 )
0022 mark_as_advanced(DETRAY_EIGEN_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_EIGEN_SOURCE_FULL "${DETRAY_EIGEN_SOURCE};SYSTEM")
0027 else()
0028 set(DETRAY_EIGEN_SOURCE_FULL "${DETRAY_EIGEN_SOURCE}")
0029 endif()
0030 mark_as_advanced(DETRAY_EIGEN_SOURCE_FULL)
0031
0032 FetchContent_Declare(Eigen3 ${DETRAY_EIGEN_SOURCE_FULL})
0033
0034 # Turn off the unit tests for Eigen3.
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(Eigen3)
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 Eigen headers as "system headers", to avoid getting warnings from
0057 # them.
0058 get_target_property(_incDirs eigen INTERFACE_INCLUDE_DIRECTORIES)
0059 target_include_directories(eigen SYSTEM INTERFACE ${_incDirs})