Warning, /acts/Detray/extern/nlohmann_json/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_minimum_required(VERSION 3.11)
0010 include(FetchContent)
0011
0012 # Silence FetchContent warnings with CMake >=3.24.
0013 if(POLICY CMP0135)
0014 cmake_policy(SET CMP0135 NEW)
0015 endif()
0016
0017 # Tell the user what's happening.
0018 message(STATUS "Building nlohmann_json as part of the detray project")
0019
0020 # Declare where to get Eigen3 from.
0021 set(DETRAY_NLOHMANN_SOURCE
0022 "URL;https://github.com/nlohmann/json/archive/refs/tags/v${DETRAY_NLOHMANN_VERSION}.tar.gz;URL_HASH;SHA1=${DETRAY_NLOHMANN_DIGEST}"
0023 CACHE STRING
0024 "Source for Nlohmann JSON, when built as part of this project"
0025 )
0026 mark_as_advanced(DETRAY_EIGEN_SOURCE)
0027
0028 # Mark the import as a system library on modern CMake versions
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_NLOHMANN_JSON_SOURCE_FULL "${DETRAY_NLOHMANN_SOURCE};SYSTEM")
0032 else()
0033 set(DETRAY_NLOHMANN_JSON_SOURCE_FULL "${DETRAY_NLOHMANN_SOURCE}")
0034 endif()
0035 mark_as_advanced(DETRAY_NLOHMANN_JSON_SOURCE_FULL)
0036
0037 FetchContent_Declare(nlohmann_json ${DETRAY_NLOHMANN_JSON_SOURCE_FULL})
0038
0039 # Now set up its build.
0040 set(JSON_BuildTests OFF CACHE INTERNAL "")
0041 set(JSON_Install ON CACHE INTERNAL "")
0042 FetchContent_MakeAvailable(nlohmann_json)