Back to home page

EIC code displayed by LXR

 
 

    


Warning, /juggler/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # SPDX-License-Identifier: LGPL-3.0-or-later
0002 # Copyright (C) 2022 Wouter Deconinck, Whitney Armstrong
0003 
0004 cmake_minimum_required(VERSION 3.19)
0005 
0006 # CMP0074: find_package() uses <PackageName>_ROOT variables
0007 cmake_policy(SET CMP0074 NEW)
0008 
0009 project(Juggler VERSION 4.3.0)
0010 
0011 set(CMAKE_CXX_STANDARD 20 CACHE STRING "")
0012 if(NOT CMAKE_CXX_STANDARD MATCHES "20")
0013   message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}")
0014 endif()
0015 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0016 set(CMAKE_CXX_EXTENSIONS OFF)
0017 
0018 # Export compile commands as json for run-clang-tidy
0019 set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
0020 
0021 # Also use clang-tidy integration in CMake
0022 option(ENABLE_CLANG_TIDY "Enable clang-tidy integration in cmake" OFF)
0023 if(ENABLE_CLANG_TIDY)
0024   find_program(CLANG_TIDY_EXE NAMES "clang-tidy")
0025   if (CLANG_TIDY_EXE)
0026     message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
0027     set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}" CACHE STRING "" FORCE)
0028   else()
0029     set(CMAKE_CXX_CLANG_TIDY "" CACHE STRING "" FORCE)
0030   endif()
0031 endif()
0032 
0033 # Set default build type
0034 set(default_build_type "Release")
0035 if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
0036   set(default_build_type "RelWithDebInfo")
0037 endif()
0038 if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
0039   message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
0040   set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
0041       STRING "Choose the type of build." FORCE)
0042   # Set the possible values of build type for cmake-gui
0043   set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
0044     "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
0045 endif()
0046 
0047 # Set all warnings
0048 if(NOT CMAKE_BUILD_TYPE MATCHES Release)
0049   add_compile_options(-Wall -Wextra -Werror -Wno-error=deprecated-declarations)
0050 endif()
0051 
0052 find_package(Microsoft.GSL CONFIG)
0053 
0054 find_package(EDM4EIC REQUIRED)
0055 find_package(EDM4HEP 0.4.1 REQUIRED)
0056 
0057 find_package(podio 0.16.3 REQUIRED)
0058 add_definitions("-Dpodio_VERSION_MAJOR=${podio_VERSION_MAJOR}")
0059 add_definitions("-Dpodio_VERSION_MINOR=${podio_VERSION_MINOR}")
0060 add_definitions("-Dpodio_VERSION_PATCH=${podio_VERSION_PATCH}")
0061 
0062 find_package(ROOT COMPONENTS Core RIO Tree MathCore GenVector Geom REQUIRED)
0063 find_package(DD4hep COMPONENTS DDRec REQUIRED)
0064 
0065 find_package(Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo PluginDD4hep PluginJson)
0066 set(Acts_VERSION_MIN "20.2.0")
0067 set(Acts_VERSION "${Acts_VERSION_MAJOR}.${Acts_VERSION_MINOR}.${Acts_VERSION_PATCH}")
0068 if(${Acts_VERSION} VERSION_LESS ${Acts_VERSION_MIN}
0069    AND NOT "${Acts_VERSION}" STREQUAL "9.9.9")
0070   message(FATAL_ERROR "Acts version ${Acts_VERSION_MIN} or higher required, but ${Acts_VERSION} found")
0071 endif()
0072 add_definitions("-DActs_VERSION_MAJOR=${Acts_VERSION_MAJOR}")
0073 add_definitions("-DActs_VERSION_MINOR=${Acts_VERSION_MINOR}")
0074 add_definitions("-DActs_VERSION_PATCH=${Acts_VERSION_PATCH}")
0075 # Get ActsCore path for ActsExamples include
0076 get_target_property(ActsCore_LOCATION ActsCore LOCATION)
0077 get_filename_component(ActsCore_PATH ${ActsCore_LOCATION} DIRECTORY)
0078 
0079 ## Dependencies
0080 find_package(algorithms)
0081 find_package(Gaudi)
0082 find_package(k4FWCore)
0083 
0084 ## Components
0085 add_subdirectory(JugBase)
0086 add_subdirectory(JugAlgo)
0087 add_subdirectory(JugDigi)
0088 add_subdirectory(JugFast)
0089 add_subdirectory(JugPID)
0090 add_subdirectory(JugReco)
0091 add_subdirectory(JugTrack)
0092 
0093 ## CMake config
0094 gaudi_install(CMAKE)
0095 
0096 # create and install Juggler.xenv file as it still has a use-case
0097 # TODO: update workflow to not need xenv files anymore
0098 include(cmake/xenv.cmake)