From e6b73b51e9f4a9f40f1c7aea7445a4f3b84e9d84 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Mon, 19 Aug 2024 14:53:07 +0200 Subject: [PATCH 1/3] perf: Drop `stateBuffer` from Core CKF (#3458) I noticed that we recreate this buffer for every `findTracks` call which seems to be a massive overhead at the moment. Not sure if we want to pass it in from outside or just use the given container to store these temporary states in. The user will copy out the track and clear the container anyways which keeps memory allocated and should leave enough space for consecutive calls. --- .../Acts/TrackFinding/CombinatorialKalmanFilter.hpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp index f4e776bbd58..9231ed580d9 100644 --- a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp +++ b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp @@ -255,9 +255,6 @@ struct CombinatorialKalmanFilterResult { /// Indices into `tracks` which mark active branches std::vector collectedTracks; - /// This is used internally to store candidate trackstates - std::shared_ptr stateBuffer; - /// Track state candidates buffer std::vector trackStateCandidates; @@ -364,8 +361,6 @@ class CombinatorialKalmanFilter { trackStateCandidates.reserve(std::distance(slBegin, slEnd)); } - bufferTrajectory.clear(); - // Calibrate all the source links on the surface since the selection has // to be done based on calibrated measurement for (auto it = slBegin; it != slEnd; ++it) { @@ -734,7 +729,7 @@ class CombinatorialKalmanFilter { Acts::Result>; TrackStatesResult tsRes = trackStateCandidateCreator( state.geoContext, *calibrationContextPtr, *surface, boundState, - slBegin, slEnd, prevTip, *result.stateBuffer, + slBegin, slEnd, prevTip, *result.trackStates, result.trackStateCandidates, *result.trackStates, logger()); if (!tsRes.ok()) { ACTS_ERROR( @@ -1290,7 +1285,6 @@ class CombinatorialKalmanFilter { .template get>(); r.tracks = &trackContainer; r.trackStates = &trackContainer.trackStateContainer(); - r.stateBuffer = std::make_shared(); auto rootBranch = trackContainer.makeTrack(); r.activeBranches.push_back(rootBranch); From a7683737faab0c431da460e933db125bac7bf406 Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Mon, 19 Aug 2024 17:18:30 +0200 Subject: [PATCH 2/3] chore: Add cmake-format to pre-commit (#3497) This PR adds gersemi to the pre-commit config and formats all CMake files. --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 + Alignment/CMakeLists.txt | 27 +- CMakeLists.txt | 434 +++++++----- Core/CMakeLists.txt | 152 ++--- Core/src/AmbiguityResolution/CMakeLists.txt | 6 +- Core/src/Definitions/CMakeLists.txt | 8 +- Core/src/Detector/CMakeLists.txt | 50 +- Core/src/EventData/CMakeLists.txt | 18 +- Core/src/Geometry/CMakeLists.txt | 72 +- Core/src/MagneticField/CMakeLists.txt | 7 +- Core/src/Material/CMakeLists.txt | 44 +- Core/src/Propagator/CMakeLists.txt | 24 +- Core/src/Surfaces/CMakeLists.txt | 62 +- Core/src/TrackFinding/CMakeLists.txt | 14 +- Core/src/TrackFitting/CMakeLists.txt | 50 +- Core/src/Utilities/CMakeLists.txt | 18 +- Core/src/Vertexing/CMakeLists.txt | 44 +- Core/src/Visualization/CMakeLists.txt | 7 +- Examples/Algorithms/Alignment/CMakeLists.txt | 29 +- .../AmbiguityResolution/CMakeLists.txt | 22 +- .../Algorithms/Digitization/CMakeLists.txt | 30 +- Examples/Algorithms/Fatras/CMakeLists.txt | 20 +- Examples/Algorithms/Geant4/CMakeLists.txt | 83 ++- .../Algorithms/Geant4HepMC/CMakeLists.txt | 35 +- Examples/Algorithms/Generators/CMakeLists.txt | 23 +- .../GeneratorsPythia8/CMakeLists.txt | 26 +- Examples/Algorithms/Geometry/CMakeLists.txt | 14 +- Examples/Algorithms/HepMC/CMakeLists.txt | 24 +- .../Algorithms/MaterialMapping/CMakeLists.txt | 25 +- Examples/Algorithms/Printers/CMakeLists.txt | 23 +- .../Algorithms/Propagation/CMakeLists.txt | 18 +- .../Algorithms/TrackFinding/CMakeLists.txt | 44 +- .../TrackFindingExaTrkX/CMakeLists.txt | 26 +- .../Algorithms/TrackFindingML/CMakeLists.txt | 28 +- .../Algorithms/TrackFitting/CMakeLists.txt | 35 +- .../Algorithms/TruthTracking/CMakeLists.txt | 36 +- Examples/Algorithms/Utilities/CMakeLists.txt | 37 +- Examples/Algorithms/Vertexing/CMakeLists.txt | 30 +- .../ContextualDetector/CMakeLists.txt | 27 +- .../Detectors/DD4hepDetector/CMakeLists.txt | 43 +- .../Detectors/Geant4Detector/CMakeLists.txt | 16 +- .../Detectors/GenericDetector/CMakeLists.txt | 28 +- .../Detectors/MagneticField/CMakeLists.txt | 31 +- .../CMakeLists.txt | 22 +- .../Detectors/TGeoDetector/CMakeLists.txt | 34 +- .../TelescopeDetector/CMakeLists.txt | 25 +- Examples/Framework/CMakeLists.txt | 107 +-- Examples/Framework/ML/CMakeLists.txt | 25 +- Examples/HelloWorld/CMakeLists.txt | 23 +- Examples/Io/Csv/CMakeLists.txt | 63 +- Examples/Io/EDM4hep/CMakeLists.txt | 53 +- Examples/Io/HepMC3/CMakeLists.txt | 37 +- Examples/Io/Json/CMakeLists.txt | 33 +- .../Io/NuclearInteractions/CMakeLists.txt | 26 +- Examples/Io/Obj/CMakeLists.txt | 18 +- Examples/Io/Performance/CMakeLists.txt | 30 +- Examples/Io/Root/CMakeLists.txt | 81 +-- Examples/Io/Svg/CMakeLists.txt | 16 +- Examples/Python/CMakeLists.txt | 340 ++++++---- .../Scripts/MaterialMapping/CMakeLists.txt | 17 +- .../TrackingPerformance/CMakeLists.txt | 39 +- Fatras/CMakeLists.txt | 54 +- Fatras/Geant4/CMakeLists.txt | 45 +- Plugins/ActSVG/CMakeLists.txt | 48 +- Plugins/Cuda/CMakeLists.txt | 97 ++- Plugins/Cuda/src/Seeding/CMakeLists.txt | 6 +- Plugins/DD4hep/CMakeLists.txt | 56 +- Plugins/Detray/CMakeLists.txt | 48 +- Plugins/EDM4hep/CMakeLists.txt | 32 +- Plugins/ExaTrkX/CMakeLists.txt | 134 ++-- Plugins/FpeMonitoring/CMakeLists.txt | 301 +++++---- Plugins/Geant4/CMakeLists.txt | 38 +- Plugins/GeoModel/CMakeLists.txt | 55 +- Plugins/Json/CMakeLists.txt | 71 +- Plugins/Legacy/CMakeLists.txt | 31 +- Plugins/Onnx/CMakeLists.txt | 44 +- Plugins/Podio/CMakeLists.txt | 95 ++- Plugins/TGeo/CMakeLists.txt | 53 +- Tests/Benchmarks/CMakeLists.txt | 34 +- Tests/CommonHelpers/CMakeLists.txt | 26 +- Tests/DownstreamProject/CMakeLists.txt | 48 +- Tests/DownstreamProjectNodeps/CMakeLists.txt | 13 +- Tests/IntegrationTests/CMakeLists.txt | 42 +- Tests/UnitTests/CMakeLists.txt | 185 +++--- .../Core/MagneticField/CMakeLists.txt | 1 - ...MagneticFieldInterfaceConsistencyTests.cpp | 86 --- Tests/UnitTests/Core/Utilities/CMakeLists.txt | 14 +- .../Plugins/Cuda/Seeding/CMakeLists.txt | 5 +- .../Plugins/Cuda/Seeding2/CMakeLists.txt | 34 +- Tests/UnitTests/Plugins/DD4hep/CMakeLists.txt | 78 ++- .../Plugins/FpeMonitoring/CMakeLists.txt | 9 +- Tests/UnitTests/Plugins/TGeo/CMakeLists.txt | 2 +- cmake/ActsCompilerOptions.cmake | 34 +- cmake/ActsComponentsHelpers.cmake | 46 +- cmake/ActsCreatePackageConfig.cmake | 36 +- cmake/ActsCreateSetup.cmake | 24 +- cmake/ActsExternSources.cmake | 90 ++- cmake/ActsGenerateNonCompileTest.cmake | 9 +- cmake/ActsOptionHelpers.cmake | 12 +- cmake/ActsRetrieveVersion.cmake | 8 +- cmake/ActsStaticAnalysis.cmake | 89 +-- cmake/ActsTargetLinkLibrariesSystem.cmake | 65 +- cmake/FindFilesystem.cmake | 70 +- cmake/FindOnnxRuntime.cmake | 73 +- cmake/FindPythia8.cmake | 48 +- cmake/FindSphinx.cmake | 45 +- cmake/FindTBB.cmake | 626 ++++++++++-------- cmake/GetGitRevisionDescription.cmake | 210 +++--- docs/CMakeLists.txt | 17 +- thirdparty/FRNN/CMakeLists.txt | 12 +- thirdparty/actsvg/CMakeLists.txt | 8 +- thirdparty/algebra-plugins/CMakeLists.txt | 86 ++- thirdparty/covfie/CMakeLists.txt | 26 +- thirdparty/detray/CMakeLists.txt | 96 +-- thirdparty/eigen3/CMakeLists.txt | 10 +- thirdparty/nlohmann_json/CMakeLists.txt | 8 +- thirdparty/pybind11/CMakeLists.txt | 8 +- thirdparty/traccc/CMakeLists.txt | 82 +-- thirdparty/vecmem/CMakeLists.txt | 24 +- 119 files changed, 3518 insertions(+), 2914 deletions(-) delete mode 100644 Tests/UnitTests/Core/MagneticField/MagneticFieldInterfaceConsistencyTests.cpp diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 908c2c8e2aa..b8941ba3802 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,3 +20,9 @@ repos: rev: 24.4.2 hooks: - id: black-jupyter + + - repo: https://github.com/BlankSpruce/gersemi + rev: 0.15.0 + hooks: + - id: gersemi + args: ["-i", "--no-warn-about-unknown-commands"] diff --git a/Alignment/CMakeLists.txt b/Alignment/CMakeLists.txt index e33424fc5a0..460b2c09674 100644 --- a/Alignment/CMakeLists.txt +++ b/Alignment/CMakeLists.txt @@ -1,21 +1,18 @@ -add_library(ActsAlignment SHARED - src/Kernel/detail/AlignmentEngine.cpp) +add_library(ActsAlignment SHARED src/Kernel/detail/AlignmentEngine.cpp) target_include_directories( - ActsAlignment - PUBLIC - $ - $) + ActsAlignment + PUBLIC + $ + $ +) -target_link_libraries( - ActsAlignment - PUBLIC ActsCore) +target_link_libraries(ActsAlignment PUBLIC ActsCore) install( - TARGETS ActsAlignment - EXPORT ActsAlignmentTargets + TARGETS ActsAlignment + EXPORT ActsAlignmentTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -install( - DIRECTORY include/ActsAlignment - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) +install(DIRECTORY include/ActsAlignment DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce643320eee..00812162c4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,8 @@ project(Acts VERSION ${_acts_version} LANGUAGES CXX) # that it is off/empty by default. if you think that is not possible, then # it probably is not an optional component. # core related options +# Formatting needs to be preserved here for parsing +# gersemi: off set(ACTS_PARAMETER_DEFINITIONS_HEADER "" CACHE FILEPATH "Use a different (track) parameter definitions header") set(ACTS_SOURCELINK_SBO_SIZE "" CACHE STRING "Customize the SBO size used by SourceLink") option(ACTS_FORCE_ASSERTIONS "Force assertions regardless of build type" OFF) @@ -95,6 +97,7 @@ set(ACTS_GPERF_INSTALL_DIR "" CACHE STRING "Hint to help find gperf if profiling option(ACTS_ENABLE_LOG_FAILURE_THRESHOLD "Enable failing on log messages with level above certain threshold" OFF) set(ACTS_LOG_FAILURE_THRESHOLD "" CACHE STRING "Log level above which an exception should be automatically thrown. If ACTS_ENABLE_LOG_FAILURE_THRESHOLD is set and this is unset, this will enable a runtime check of the log level.") +# gersemi: on # handle option inter-dependencies and the everything flag # NOTE: ordering is important here. dependencies must come before dependees @@ -109,59 +112,75 @@ set_option_if( OR ACTS_BUILD_EXAMPLES_HEPMC3 OR ACTS_BUILD_EXAMPLES_PYTHIA8 OR ACTS_BUILD_EXAMPLES_EXATRKX - OR ACTS_BUILD_EXAMPLES_PYTHON_BINDINGS) + OR ACTS_BUILD_EXAMPLES_PYTHON_BINDINGS +) # core plugins might be required by examples or depend on each other set_option_if( ACTS_BUILD_PLUGIN_DD4HEP ACTS_BUILD_EXAMPLES_DD4HEP OR - ACTS_BUILD_EXAMPLES_EDM4HEP) + ACTS_BUILD_EXAMPLES_EDM4HEP +) set_option_if( ACTS_BUILD_PLUGIN_EDM4HEP - ACTS_BUILD_EXAMPLES_EDM4HEP) + ACTS_BUILD_EXAMPLES_EDM4HEP +) set_option_if( ACTS_BUILD_PLUGIN_PODIO - ACTS_BUILD_EXAMPLES_EDM4HEP) + ACTS_BUILD_EXAMPLES_EDM4HEP +) set_option_if( ACTS_BUILD_PLUGIN_GEANT4 - ACTS_BUILD_EXAMPLES_GEANT4) + ACTS_BUILD_EXAMPLES_GEANT4 +) set_option_if( ACTS_BUILD_PLUGIN_TGEO ACTS_BUILD_PLUGIN_DD4HEP OR - ACTS_BUILD_EXAMPLES) + ACTS_BUILD_EXAMPLES +) set_option_if( ACTS_BUILD_PLUGIN_IDENTIFICATION ACTS_BUILD_PLUGIN_TGEO OR ACTS_BUILD_PLUGIN_PODIO OR - ACTS_BUILD_EXAMPLES) + ACTS_BUILD_EXAMPLES +) set_option_if( ACTS_BUILD_PLUGIN_JSON - ACTS_BUILD_EXAMPLES) + ACTS_BUILD_EXAMPLES +) set_option_if( ACTS_BUILD_FATRAS - ACTS_BUILD_EXAMPLES) + ACTS_BUILD_EXAMPLES +) set_option_if( ACTS_BUILD_PLUGIN_EXATRKX - ACTS_BUILD_EXAMPLES_EXATRKX) + ACTS_BUILD_EXAMPLES_EXATRKX +) set_option_if( ACTS_BUILD_PLUGIN_FPEMON - ACTS_BUILD_EXAMPLES) + ACTS_BUILD_EXAMPLES +) set_option_if( ACTS_BUILD_PLUGIN_JSON - ACTS_BUILD_PLUGIN_TRACCC) + ACTS_BUILD_PLUGIN_TRACCC +) # feature tests include(CheckCXXSourceCompiles) # function that tests if the root installation is compatible function(check_root_compatibility) - get_target_property(ROOT_INCLUDE_DIR ROOT::Core INTERFACE_INCLUDE_DIRECTORIES) - set(CMAKE_REQUIRED_INCLUDES ${ROOT_INCLUDE_DIR}) - #yolo - #check_cxx_source_compiles(" #include \n #include \nint main(){}" ROOT_COMPATIBILITY_CHECK) - #if(NOT ROOT_COMPATIBILITY_CHECK) - # message(FATAL_ERROR "Root installation is misconfigured. Ensure that your Root installation was compiled.") - #endif() + get_target_property( + ROOT_INCLUDE_DIR + ROOT::Core + INTERFACE_INCLUDE_DIRECTORIES + ) + set(CMAKE_REQUIRED_INCLUDES ${ROOT_INCLUDE_DIR}) + #yolo + #check_cxx_source_compiles(" #include \n #include \nint main(){}" ROOT_COMPATIBILITY_CHECK) + #if(NOT ROOT_COMPATIBILITY_CHECK) + # message(FATAL_ERROR "Root installation is misconfigured. Ensure that your Root installation was compiled.") + #endif() endfunction() # additional configuration and tools @@ -171,13 +190,24 @@ include(ActsComponentsHelpers) # handle components via add_..._if commands include(ActsStaticAnalysis) # place build products in `/bin` and `/lib` for simple use -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}") -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY + "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}" +) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY + "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}" +) # This needs to happen before we set up any targets if(ACTS_FORCE_ASSERTIONS) - message(STATUS "Injecting headers to force assertions. This can have side-effects, USE WITH CAUTION!") - include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/cmake/assert_include) + message( + STATUS + "Injecting headers to force assertions. This can have side-effects, USE WITH CAUTION!" + ) + include_directories( + BEFORE + SYSTEM + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/assert_include + ) endif() # minimal dependency versions. they are defined here in a single place so @@ -214,37 +244,49 @@ include(ActsExternSources) # Controls behavior of DOWNLOAD_EXTRACT_TIMESTAMP if(POLICY CMP0135) - cmake_policy(SET CMP0135 NEW) + cmake_policy(SET CMP0135 NEW) endif() # required packages -if (ACTS_SETUP_BOOST) - if(POLICY CMP0167) - cmake_policy(SET CMP0167 NEW) - endif() - - # Enable both program_options and unit_test_framework to reduce complexity - # Also Cuda tests seem to use program_options - if( ACTS_BUILD_ANALYSIS_APPS OR ACTS_BUILD_UNITTESTS OR ACTS_BUILD_INTEGRATIONTESTS OR ACTS_BUILD_BENCHMARKS ) - find_package(Boost ${_acts_boost_version} REQUIRED COMPONENTS program_options unit_test_framework) - else() - find_package(Boost ${_acts_boost_version} REQUIRED COMPONENTS) - endif() - - if(Boost_VERSION VERSION_LESS _acts_boost_recommended_version) - message(WARNING "Found Boost ${Boost_VERSION} - recommended is at least ${_acts_boost_recommended_version}") - endif() +if(ACTS_SETUP_BOOST) + if(POLICY CMP0167) + cmake_policy(SET CMP0167 NEW) + endif() + + # Enable both program_options and unit_test_framework to reduce complexity + # Also Cuda tests seem to use program_options + if( + ACTS_BUILD_ANALYSIS_APPS + OR ACTS_BUILD_UNITTESTS + OR ACTS_BUILD_INTEGRATIONTESTS + OR ACTS_BUILD_BENCHMARKS + ) + find_package( + Boost + ${_acts_boost_version} + REQUIRED + COMPONENTS program_options unit_test_framework + ) + else() + find_package(Boost ${_acts_boost_version} REQUIRED COMPONENTS) + endif() + + if(Boost_VERSION VERSION_LESS _acts_boost_recommended_version) + message( + WARNING + "Found Boost ${Boost_VERSION} - recommended is at least ${_acts_boost_recommended_version}" + ) + endif() endif() -if (ACTS_SETUP_EIGEN3) - if (ACTS_USE_SYSTEM_EIGEN3) - find_package(Eigen3 ${_acts_eigen3_version} REQUIRED CONFIG) - else() - add_subdirectory(thirdparty/eigen3) - endif() +if(ACTS_SETUP_EIGEN3) + if(ACTS_USE_SYSTEM_EIGEN3) + find_package(Eigen3 ${_acts_eigen3_version} REQUIRED CONFIG) + else() + add_subdirectory(thirdparty/eigen3) + endif() endif() - find_package(Filesystem REQUIRED) # the `_VERSION` variables set by `setup(... VERSION ...)` have @@ -254,22 +296,28 @@ find_package(Filesystem REQUIRED) # global scope and is accessible within the main project later on. cmake_policy(SET CMP0048 NEW) macro(project) - _project(${ARGN}) - set(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION}" CACHE INTERNAL "") + _project(${ARGN}) + set(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION}" CACHE INTERNAL "") endmacro() # CUDA settings are collected here in a macro, so that they can be reused by different plugins macro(enable_cuda) - enable_language(CUDA) - set(CMAKE_CUDA_STANDARD 14 CACHE STRING "CUDA C++ standard to use") - set(CMAKE_CUDA_STANDARD_REQUIRED ON CACHE BOOL - "Force the C++ standard requirement") - if(NOT CMAKE_CUDA_ARCHITECTURES) - set(CMAKE_CUDA_ARCHITECTURES "35;52;75" CACHE STRING - "CUDA architectures to generate code for") - endif() - set(CMAKE_CUDA_FLAGS_DEBUG "${CMAKE_CUDA_FLAGS_DEBUG} -g -G") - set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --extended-lambda") + enable_language(CUDA) + set(CMAKE_CUDA_STANDARD 14 CACHE STRING "CUDA C++ standard to use") + set(CMAKE_CUDA_STANDARD_REQUIRED + ON + CACHE BOOL + "Force the C++ standard requirement" + ) + if(NOT CMAKE_CUDA_ARCHITECTURES) + set(CMAKE_CUDA_ARCHITECTURES + "35;52;75" + CACHE STRING + "CUDA architectures to generate code for" + ) + endif() + set(CMAKE_CUDA_FLAGS_DEBUG "${CMAKE_CUDA_FLAGS_DEBUG} -g -G") + set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --extended-lambda") endmacro() # optional packages @@ -278,152 +326,194 @@ endmacro() # the same package twice. This avoids having complex if/else trees to sort out # when a particular package is actually needed. if(ACTS_BUILD_PLUGIN_ACTSVG) - if(ACTS_USE_SYSTEM_ACTSVG) - find_package(actsvg ${_acts_actsvg_version} REQUIRED CONFIG) - else() - add_subdirectory(thirdparty/actsvg) - endif() + if(ACTS_USE_SYSTEM_ACTSVG) + find_package(actsvg ${_acts_actsvg_version} REQUIRED CONFIG) + else() + add_subdirectory(thirdparty/actsvg) + endif() endif() if(ACTS_BUILD_PLUGIN_CUDA) - enable_cuda() + enable_cuda() endif() if(ACTS_BUILD_PLUGIN_DD4HEP) - # Explicitly find python so we can more easily override the version - find_package(Python 3.8 REQUIRED COMPONENTS Interpreter Development) - find_package(DD4hep ${_acts_dd4hep_version} REQUIRED CONFIG COMPONENTS DDCore DDDetectors) + # Explicitly find python so we can more easily override the version + find_package(Python 3.8 REQUIRED COMPONENTS Interpreter Development) + find_package( + DD4hep + ${_acts_dd4hep_version} + REQUIRED + CONFIG + COMPONENTS DDCore DDDetectors + ) endif() if(ACTS_BUILD_PLUGIN_JSON) - if(ACTS_USE_SYSTEM_NLOHMANN_JSON) - find_package(nlohmann_json ${_acts_nlohmanjson_version} REQUIRED CONFIG) - else() - add_subdirectory(thirdparty/nlohmann_json) - endif() + if(ACTS_USE_SYSTEM_NLOHMANN_JSON) + find_package(nlohmann_json ${_acts_nlohmanjson_version} REQUIRED CONFIG) + else() + add_subdirectory(thirdparty/nlohmann_json) + endif() endif() if(ACTS_BUILD_PLUGIN_GEOMODEL) - find_package(GeoModelCore ${_acts_geomodel_version} REQUIRED CONFIG) - find_package(GeoModelIO ${_acts_geomodel_version} REQUIRED CONFIG) + find_package(GeoModelCore ${_acts_geomodel_version} REQUIRED CONFIG) + find_package(GeoModelIO ${_acts_geomodel_version} REQUIRED CONFIG) endif() if(ACTS_BUILD_PLUGIN_TGEO) - find_package(ROOT ${_acts_root_version} REQUIRED CONFIG COMPONENTS Geom Graf) - check_root_compatibility() + find_package( + ROOT + ${_acts_root_version} + REQUIRED + CONFIG + COMPONENTS Geom Graf + ) + check_root_compatibility() endif() if(ACTS_BUILD_ANALYSIS_APPS) - find_package(ROOT ${_acts_root_version} REQUIRED CONFIG COMPONENTS Geom Graf) - check_root_compatibility() + find_package( + ROOT + ${_acts_root_version} + REQUIRED + CONFIG + COMPONENTS Geom Graf + ) + check_root_compatibility() endif() if(ACTS_BUILD_PLUGIN_EXATRKX) - find_package(Torch REQUIRED) - if(ACTS_EXATRKX_ENABLE_CUDA) - find_package(CUDAToolkit REQUIRED) - enable_cuda() - add_subdirectory(thirdparty/FRNN) - message(STATUS "Build Exa.TrkX plugin with CUDA") - else() - message(STATUS "Build Exa.TrkX plugin for CPU only") - endif() - if(NOT (ACTS_EXATRKX_ENABLE_ONNX OR ACTS_EXATRKX_ENABLE_TORCH)) - message(FATAL_ERROR - "When building the Exa.TrkX plugin, at least one of ACTS_EXATRKX_ENABLE_ONNX \ + find_package(Torch REQUIRED) + if(ACTS_EXATRKX_ENABLE_CUDA) + find_package(CUDAToolkit REQUIRED) + enable_cuda() + add_subdirectory(thirdparty/FRNN) + message(STATUS "Build Exa.TrkX plugin with CUDA") + else() + message(STATUS "Build Exa.TrkX plugin for CPU only") + endif() + if(NOT (ACTS_EXATRKX_ENABLE_ONNX OR ACTS_EXATRKX_ENABLE_TORCH)) + message( + FATAL_ERROR + "When building the Exa.TrkX plugin, at least one of ACTS_EXATRKX_ENABLE_ONNX \ and ACTS_EXATRKX_ENABLE_TORCHSCRIPT must be enabled." - ) - endif() - if(ACTS_EXATRKX_ENABLE_ONNX) - find_package(cugraph REQUIRED) - endif() - if(ACTS_EXATRKX_ENABLE_TORCH) - find_package(TorchScatter REQUIRED) - endif() + ) + endif() + if(ACTS_EXATRKX_ENABLE_ONNX) + find_package(cugraph REQUIRED) + endif() + if(ACTS_EXATRKX_ENABLE_TORCH) + find_package(TorchScatter REQUIRED) + endif() endif() if(ACTS_BUILD_PLUGIN_ONNX OR ACTS_EXATRKX_ENABLE_ONNX) - find_package(OnnxRuntime ${_acts_onnxruntime_version} REQUIRED) + find_package(OnnxRuntime ${_acts_onnxruntime_version} REQUIRED) endif() if(ACTS_BUILD_PLUGIN_EDM4HEP OR ACTS_BUILD_PLUGIN_PODIO) - find_package(podio ${_acts_podio_version} CONFIG) - if(NOT podio_FOUND) - message(STATUS "Podio not found, trying ${_acts_podio_fallback_version} version") - find_package(podio ${_acts_podio_fallback_version} CONFIG REQUIRED) - endif() - find_package(ROOT ${_acts_root_version} REQUIRED CONFIG COMPONENTS Core) + find_package(podio ${_acts_podio_version} CONFIG) + if(NOT podio_FOUND) + message( + STATUS + "Podio not found, trying ${_acts_podio_fallback_version} version" + ) + find_package(podio ${_acts_podio_fallback_version} CONFIG REQUIRED) + endif() + find_package(ROOT ${_acts_root_version} REQUIRED CONFIG COMPONENTS Core) endif() if(ACTS_BUILD_PLUGIN_EDM4HEP) - find_package(EDM4HEP ${_acts_edm4hep_version} REQUIRED CONFIG) + find_package(EDM4HEP ${_acts_edm4hep_version} REQUIRED CONFIG) endif() if(ACTS_BUILD_PLUGIN_GEANT4) - find_package(Geant4 REQUIRED CONFIG COMPONENTS gdml) + find_package(Geant4 REQUIRED CONFIG COMPONENTS gdml) endif() if(ACTS_BUILD_PLUGIN_TRACCC) - if (ACTS_USE_SYSTEM_ALGEBRAPLUGINS) - find_package(algebra-plugins ${_acts_algebraplugins_version} REQUIRED) - else() - add_subdirectory(thirdparty/algebra-plugins) - endif() - - if(ACTS_USE_SYSTEM_DETRAY) - find_package(detray ${_acts_detray_version} REQUIRED CONFIG) - else() - add_subdirectory(thirdparty/detray) - endif() - - if (ACTS_USE_SYSTEM_VECMEM) - find_package(vecmem ${_acts_vecmem_version} REQUIRED) - else() - add_subdirectory(thirdparty/vecmem) - # Make the "VecMem language code" available for the whole project. - include( "${VECMEM_LANGUAGE_DIR}/vecmem-check-language.cmake" ) - endif() - - if(ACTS_USE_SYSTEM_COVFIE) - find_package(covfie ${_acts_covfie_version} REQUIRED CONFIG) - else() - add_subdirectory(thirdparty/covfie) - endif() - - # traccc also depends on vecmem and covfie, but those plugins should always - # be enabled if traccc is. - if(ACTS_USE_SYSTEM_TRACCC) - find_package(traccc ${_acts_traccc_version} REQUIRED CONFIG) - else() - add_subdirectory(thirdparty/traccc) - endif() + if(ACTS_USE_SYSTEM_ALGEBRAPLUGINS) + find_package(algebra-plugins ${_acts_algebraplugins_version} REQUIRED) + else() + add_subdirectory(thirdparty/algebra-plugins) + endif() + + if(ACTS_USE_SYSTEM_DETRAY) + find_package(detray ${_acts_detray_version} REQUIRED CONFIG) + else() + add_subdirectory(thirdparty/detray) + endif() + + if(ACTS_USE_SYSTEM_VECMEM) + find_package(vecmem ${_acts_vecmem_version} REQUIRED) + else() + add_subdirectory(thirdparty/vecmem) + # Make the "VecMem language code" available for the whole project. + include("${VECMEM_LANGUAGE_DIR}/vecmem-check-language.cmake") + endif() + + if(ACTS_USE_SYSTEM_COVFIE) + find_package(covfie ${_acts_covfie_version} REQUIRED CONFIG) + else() + add_subdirectory(thirdparty/covfie) + endif() + + # traccc also depends on vecmem and covfie, but those plugins should always + # be enabled if traccc is. + if(ACTS_USE_SYSTEM_TRACCC) + find_package(traccc ${_acts_traccc_version} REQUIRED CONFIG) + else() + add_subdirectory(thirdparty/traccc) + endif() endif() - # examples dependencies if(ACTS_BUILD_EXAMPLES) - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads REQUIRED) - # for simplicity always request all potentially required components. - find_package(ROOT ${_acts_root_version} REQUIRED CONFIG COMPONENTS Core Geom Graf GenVector Hist Tree TreePlayer) - check_root_compatibility() + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads REQUIRED) + # for simplicity always request all potentially required components. + find_package( + ROOT + ${_acts_root_version} + REQUIRED + CONFIG + COMPONENTS Core Geom Graf GenVector Hist Tree TreePlayer + ) + check_root_compatibility() endif() if(ACTS_BUILD_EXAMPLES_PYTHON_BINDINGS) - find_package(Python 3.8 REQUIRED COMPONENTS Interpreter Development) - if(ACTS_USE_SYSTEM_PYBIND11) - find_package(pybind11 CONFIG REQUIRED) - else() - add_subdirectory(thirdparty/pybind11) - endif() + find_package(Python 3.8 REQUIRED COMPONENTS Interpreter Development) + if(ACTS_USE_SYSTEM_PYBIND11) + find_package(pybind11 CONFIG REQUIRED) + else() + add_subdirectory(thirdparty/pybind11) + endif() endif() if(ACTS_BUILD_EXAMPLES_DD4HEP AND ACTS_BUILD_EXAMPLES_GEANT4) - find_package(DD4hep ${_acts_dd4hep_version} REQUIRED CONFIG COMPONENTS DDCore DDG4 DDDetectors) + find_package( + DD4hep + ${_acts_dd4hep_version} + REQUIRED + CONFIG + COMPONENTS DDCore DDG4 DDDetectors + ) elseif(ACTS_BUILD_EXAMPLES_DD4HEP) - find_package(DD4hep ${_acts_dd4hep_version} REQUIRED CONFIG COMPONENTS DDCore DDDetectors) + find_package( + DD4hep + ${_acts_dd4hep_version} + REQUIRED + CONFIG + COMPONENTS DDCore DDDetectors + ) endif() if(ACTS_BUILD_EXAMPLES_HEPMC3) - find_package(HepMC3 ${_acts_hepmc3_version} REQUIRED CONFIG) + find_package(HepMC3 ${_acts_hepmc3_version} REQUIRED CONFIG) endif() if(ACTS_BUILD_EXAMPLES_PYTHIA8) - find_package(Pythia8 ${_acts_pythia8_version} REQUIRED) + find_package(Pythia8 ${_acts_pythia8_version} REQUIRED) endif() # other dependencies if(ACTS_BUILD_DOCS) - find_package(Doxygen ${_acts_doxygen_version} REQUIRED) - find_package(Sphinx REQUIRED) + find_package(Doxygen ${_acts_doxygen_version} REQUIRED) + find_package(Sphinx REQUIRED) endif() if(ACTS_CUSTOM_SCALARTYPE) - message(STATUS "Building Acts with custom scalar type: ${ACTS_CUSTOM_SCALARTYPE}") + message( + STATUS + "Building Acts with custom scalar type: ${ACTS_CUSTOM_SCALARTYPE}" + ) endif() # core library, core plugins, and other components @@ -433,28 +523,32 @@ add_component_if(Fatras Fatras ACTS_BUILD_FATRAS) add_component_if(Alignment Alignment ACTS_BUILD_ALIGNMENT) if(ACTS_BUILD_ODD) - if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/thirdparty/OpenDataDetector/CMakeLists.txt") - add_subdirectory_if(thirdparty/OpenDataDetector ACTS_BUILD_ODD) - else() - message(FATAL_ERROR "ODD build was requested, but the ODD directory seems not to be present. " - "Did you init and update the submodule?") - endif() + if( + EXISTS + "${CMAKE_CURRENT_LIST_DIR}/thirdparty/OpenDataDetector/CMakeLists.txt" + ) + add_subdirectory_if(thirdparty/OpenDataDetector ACTS_BUILD_ODD) + else() + message( + FATAL_ERROR + "ODD build was requested, but the ODD directory seems not to be present. " + "Did you init and update the submodule?" + ) + endif() endif() - # examples add_subdirectory_if(Examples ACTS_BUILD_EXAMPLES) # automated tests and benchmarks if(ACTS_BUILD_BENCHMARKS OR ACTS_BUILD_INTEGRATIONTESTS OR ACTS_BUILD_UNITTESTS) - enable_testing() # must be set in the main CMakeLists.txt - add_subdirectory(Tests) + enable_testing() # must be set in the main CMakeLists.txt + add_subdirectory(Tests) endif() # documentation add_subdirectory_if(docs ACTS_BUILD_DOCS) - # create cmake configuration files and environment setup script include(ActsCreatePackageConfig) include(ActsCreateSetup) diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 192fe05f6bf..b760ba576ed 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -1,117 +1,105 @@ configure_file( - ActsVersion.hpp.in - ${CMAKE_CURRENT_BINARY_DIR}/Acts/ActsVersion.hpp) + ActsVersion.hpp.in + ${CMAKE_CURRENT_BINARY_DIR}/Acts/ActsVersion.hpp +) # source files will be added later -add_library( - ActsCore SHARED "") +add_library(ActsCore SHARED "") -target_sources( - ActsCore - PRIVATE - src/ActsVersion.cpp) +target_sources(ActsCore PRIVATE src/ActsVersion.cpp) -target_compile_features( - ActsCore - PUBLIC ${ACTS_CXX_STANDARD_FEATURE}) +target_compile_features(ActsCore PUBLIC ${ACTS_CXX_STANDARD_FEATURE}) target_include_directories( - ActsCore - PUBLIC - $ - # for the generated version header - $ - $) -target_link_libraries( - ActsCore - PUBLIC Boost::boost Eigen3::Eigen) - + ActsCore + PUBLIC + $ + # for the generated version header + $ + $ +) +target_link_libraries(ActsCore PUBLIC Boost::boost Eigen3::Eigen) if(ACTS_PARAMETER_DEFINITIONS_HEADER) - target_compile_definitions( - ActsCore - PUBLIC -DACTS_PARAMETER_DEFINITIONS_HEADER="${ACTS_PARAMETER_DEFINITIONS_HEADER}") + target_compile_definitions( + ActsCore + PUBLIC + -DACTS_PARAMETER_DEFINITIONS_HEADER="${ACTS_PARAMETER_DEFINITIONS_HEADER}" + ) endif() if(ACTS_SOURCELINK_SBO_SIZE) - target_compile_definitions( - ActsCore - PUBLIC -DACTS_SOURCELINK_SBO_SIZE=${ACTS_SOURCELINK_SBO_SIZE}) + target_compile_definitions( + ActsCore + PUBLIC -DACTS_SOURCELINK_SBO_SIZE=${ACTS_SOURCELINK_SBO_SIZE} + ) endif() if(ACTS_CUSTOM_SCALARTYPE) - target_compile_definitions( - ActsCore - PUBLIC -DACTS_CUSTOM_SCALARTYPE=${ACTS_CUSTOM_SCALARTYPE}) + target_compile_definitions( + ActsCore + PUBLIC -DACTS_CUSTOM_SCALARTYPE=${ACTS_CUSTOM_SCALARTYPE} + ) endif() if(ACTS_LOG_FAILURE_THRESHOLD) - message(STATUS "Enable log failure threshold, set to ${ACTS_LOG_FAILURE_THRESHOLD}") - target_compile_definitions( - ActsCore - PUBLIC - -DACTS_LOG_FAILURE_THRESHOLD=${ACTS_LOG_FAILURE_THRESHOLD} - -DACTS_ENABLE_LOG_FAILURE_THRESHOLD) - + message( + STATUS + "Enable log failure threshold, set to ${ACTS_LOG_FAILURE_THRESHOLD}" + ) + target_compile_definitions( + ActsCore + PUBLIC + -DACTS_LOG_FAILURE_THRESHOLD=${ACTS_LOG_FAILURE_THRESHOLD} + -DACTS_ENABLE_LOG_FAILURE_THRESHOLD + ) else() - -if(ACTS_ENABLE_LOG_FAILURE_THRESHOLD) - message(STATUS "Enable log failure threshold") - target_compile_definitions( - ActsCore - PUBLIC - -DACTS_ENABLE_LOG_FAILURE_THRESHOLD) -endif() - + if(ACTS_ENABLE_LOG_FAILURE_THRESHOLD) + message(STATUS "Enable log failure threshold") + target_compile_definitions( + ActsCore + PUBLIC -DACTS_ENABLE_LOG_FAILURE_THRESHOLD + ) + endif() endif() if(ACTS_ENABLE_CPU_PROFILING) - message(STATUS "added lprofiler") + message(STATUS "added lprofiler") - if(NOT ACTS_GPERF_INSTALL_DIR STREQUAL "") - find_library(PROFILER_LIBRARY profiler HINTS ${ACTS_GPERF_INSTALL_DIR}) + if(NOT ACTS_GPERF_INSTALL_DIR STREQUAL "") + find_library(PROFILER_LIBRARY profiler HINTS ${ACTS_GPERF_INSTALL_DIR}) - target_link_libraries( - ActsCore - PUBLIC ${PROFILER_LIBRARY}) - else() - target_link_libraries( - ActsCore - PUBLIC -lprofiler) - endif() + target_link_libraries(ActsCore PUBLIC ${PROFILER_LIBRARY}) + else() + target_link_libraries(ActsCore PUBLIC -lprofiler) + endif() - target_link_options( - ActsCore - PUBLIC "LINKER:-no-as-needed") + target_link_options(ActsCore PUBLIC "LINKER:-no-as-needed") endif() if(ACTS_ENABLE_MEMORY_PROFILING) - message(STATUS "added ltcmalloc") - - if(NOT ACTS_GPERF_INSTALL_DIR STREQUAL "") - find_library(TCMALLOC_LIBRARY tcmalloc HINTS ${ACTS_GPERF_INSTALL_DIR}) - - target_link_libraries( - ActsCore - PUBLIC ${TCMALLOC_LIBRARY}) - else() - target_link_libraries( - ActsCore - PUBLIC -ltcmalloc) - endif() + message(STATUS "added ltcmalloc") + + if(NOT ACTS_GPERF_INSTALL_DIR STREQUAL "") + find_library(TCMALLOC_LIBRARY tcmalloc HINTS ${ACTS_GPERF_INSTALL_DIR}) + + target_link_libraries(ActsCore PUBLIC ${TCMALLOC_LIBRARY}) + else() + target_link_libraries(ActsCore PUBLIC -ltcmalloc) + endif() endif() install( - TARGETS ActsCore - EXPORT ActsCoreTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -install( - DIRECTORY include/Acts - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + TARGETS ActsCore + EXPORT ActsCoreTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) +install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/Acts/ActsVersion.hpp - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Acts) + FILES ${CMAKE_CURRENT_BINARY_DIR}/Acts/ActsVersion.hpp + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Acts +) # target source files are added separately add_subdirectory(src/EventData) diff --git a/Core/src/AmbiguityResolution/CMakeLists.txt b/Core/src/AmbiguityResolution/CMakeLists.txt index 83a50d68501..04f099979a7 100644 --- a/Core/src/AmbiguityResolution/CMakeLists.txt +++ b/Core/src/AmbiguityResolution/CMakeLists.txt @@ -1,6 +1,4 @@ target_sources( - ActsCore - PRIVATE - GreedyAmbiguityResolution.cpp - ScoreBasedAmbiguityResolution.cpp + ActsCore + PRIVATE GreedyAmbiguityResolution.cpp ScoreBasedAmbiguityResolution.cpp ) diff --git a/Core/src/Definitions/CMakeLists.txt b/Core/src/Definitions/CMakeLists.txt index c83d3dedf7f..7ab7a2d43cf 100644 --- a/Core/src/Definitions/CMakeLists.txt +++ b/Core/src/Definitions/CMakeLists.txt @@ -1,7 +1 @@ -target_sources( - ActsCore - PRIVATE - Common.cpp - Direction.cpp - ParticleData.cpp -) +target_sources(ActsCore PRIVATE Common.cpp Direction.cpp ParticleData.cpp) diff --git a/Core/src/Detector/CMakeLists.txt b/Core/src/Detector/CMakeLists.txt index 49b5c4d4996..71e6a9d4d9f 100644 --- a/Core/src/Detector/CMakeLists.txt +++ b/Core/src/Detector/CMakeLists.txt @@ -1,27 +1,27 @@ target_sources( - ActsCore - PRIVATE - detail/BlueprintHelper.cpp - detail/BlueprintDrawer.cpp - detail/CuboidalDetectorHelper.cpp - detail/CylindricalDetectorHelper.cpp - detail/DetectorVolumeConsistency.cpp - detail/PortalHelper.cpp - detail/ProtoMaterialHelper.cpp - detail/SupportSurfacesHelper.cpp - detail/IndexedGridFiller.cpp - CylindricalContainerBuilder.cpp - CuboidalContainerBuilder.cpp - Detector.cpp - DetectorBuilder.cpp - DetectorVolume.cpp - DetectorVolumeBuilder.cpp - IndexedRootVolumeFinderBuilder.cpp - LayerStructureBuilder.cpp - Portal.cpp - PortalGenerators.cpp - ProtoDetector.cpp - GeometryIdGenerator.cpp - VolumeStructureBuilder.cpp - MultiWireStructureBuilder.cpp + ActsCore + PRIVATE + detail/BlueprintHelper.cpp + detail/BlueprintDrawer.cpp + detail/CuboidalDetectorHelper.cpp + detail/CylindricalDetectorHelper.cpp + detail/DetectorVolumeConsistency.cpp + detail/PortalHelper.cpp + detail/ProtoMaterialHelper.cpp + detail/SupportSurfacesHelper.cpp + detail/IndexedGridFiller.cpp + CylindricalContainerBuilder.cpp + CuboidalContainerBuilder.cpp + Detector.cpp + DetectorBuilder.cpp + DetectorVolume.cpp + DetectorVolumeBuilder.cpp + IndexedRootVolumeFinderBuilder.cpp + LayerStructureBuilder.cpp + Portal.cpp + PortalGenerators.cpp + ProtoDetector.cpp + GeometryIdGenerator.cpp + VolumeStructureBuilder.cpp + MultiWireStructureBuilder.cpp ) diff --git a/Core/src/EventData/CMakeLists.txt b/Core/src/EventData/CMakeLists.txt index 7b43dfb74ba..08a69711378 100644 --- a/Core/src/EventData/CMakeLists.txt +++ b/Core/src/EventData/CMakeLists.txt @@ -1,11 +1,11 @@ target_sources( - ActsCore - PRIVATE - PrintParameters.cpp - TrackParameters.cpp - TransformationHelpers.cpp - CorrectedTransformationFreeToBound.cpp - TrackStatePropMask.cpp - VectorMultiTrajectory.cpp - VectorTrackContainer.cpp + ActsCore + PRIVATE + PrintParameters.cpp + TrackParameters.cpp + TransformationHelpers.cpp + CorrectedTransformationFreeToBound.cpp + TrackStatePropMask.cpp + VectorMultiTrajectory.cpp + VectorTrackContainer.cpp ) diff --git a/Core/src/Geometry/CMakeLists.txt b/Core/src/Geometry/CMakeLists.txt index fcacff5ec76..0391a99b2fb 100644 --- a/Core/src/Geometry/CMakeLists.txt +++ b/Core/src/Geometry/CMakeLists.txt @@ -1,38 +1,38 @@ target_sources( - ActsCore - PRIVATE - ConeLayer.cpp - ConeVolumeBounds.cpp - CuboidVolumeBounds.cpp - CuboidVolumeBuilder.cpp - CutoutCylinderVolumeBounds.cpp - CylinderLayer.cpp - CylinderVolumeBounds.cpp - CylinderVolumeBuilder.cpp - CylinderVolumeHelper.cpp - Extent.cpp - KDTreeTrackingGeometryBuilder.cpp - DiscLayer.cpp - GenericApproachDescriptor.cpp - GenericCuboidVolumeBounds.cpp - GeometryIdentifier.cpp - GlueVolumesDescriptor.cpp - Layer.cpp - LayerArrayCreator.cpp - LayerCreator.cpp - NavigationLayer.cpp - PassiveLayerBuilder.cpp - PlaneLayer.cpp - Polyhedron.cpp - ProtoLayer.cpp - ProtoLayerHelper.cpp - SurfaceArrayCreator.cpp - TrackingGeometry.cpp - TrackingGeometryBuilder.cpp - TrackingVolume.cpp - TrackingVolumeArrayCreator.cpp - TrapezoidVolumeBounds.cpp - Volume.cpp - VolumeBounds.cpp - CylinderVolumeStack.cpp + ActsCore + PRIVATE + ConeLayer.cpp + ConeVolumeBounds.cpp + CuboidVolumeBounds.cpp + CuboidVolumeBuilder.cpp + CutoutCylinderVolumeBounds.cpp + CylinderLayer.cpp + CylinderVolumeBounds.cpp + CylinderVolumeBuilder.cpp + CylinderVolumeHelper.cpp + Extent.cpp + KDTreeTrackingGeometryBuilder.cpp + DiscLayer.cpp + GenericApproachDescriptor.cpp + GenericCuboidVolumeBounds.cpp + GeometryIdentifier.cpp + GlueVolumesDescriptor.cpp + Layer.cpp + LayerArrayCreator.cpp + LayerCreator.cpp + NavigationLayer.cpp + PassiveLayerBuilder.cpp + PlaneLayer.cpp + Polyhedron.cpp + ProtoLayer.cpp + ProtoLayerHelper.cpp + SurfaceArrayCreator.cpp + TrackingGeometry.cpp + TrackingGeometryBuilder.cpp + TrackingVolume.cpp + TrackingVolumeArrayCreator.cpp + TrapezoidVolumeBounds.cpp + Volume.cpp + VolumeBounds.cpp + CylinderVolumeStack.cpp ) diff --git a/Core/src/MagneticField/CMakeLists.txt b/Core/src/MagneticField/CMakeLists.txt index 3f2e4333a69..4b9ebb0be0f 100644 --- a/Core/src/MagneticField/CMakeLists.txt +++ b/Core/src/MagneticField/CMakeLists.txt @@ -1,7 +1,4 @@ target_sources( - ActsCore - PRIVATE - BFieldMapUtils.cpp - SolenoidBField.cpp - MagneticFieldError.cpp + ActsCore + PRIVATE BFieldMapUtils.cpp SolenoidBField.cpp MagneticFieldError.cpp ) diff --git a/Core/src/Material/CMakeLists.txt b/Core/src/Material/CMakeLists.txt index d988867c85f..52e0e690dbb 100644 --- a/Core/src/Material/CMakeLists.txt +++ b/Core/src/Material/CMakeLists.txt @@ -1,24 +1,24 @@ target_sources( - ActsCore - PRIVATE - AccumulatedMaterialSlab.cpp - AccumulatedSurfaceMaterial.cpp - AccumulatedVolumeMaterial.cpp - AverageMaterials.cpp - BinnedSurfaceMaterial.cpp - BinnedSurfaceMaterialAccumulater.cpp - HomogeneousSurfaceMaterial.cpp - HomogeneousVolumeMaterial.cpp - Interactions.cpp - IntersectionMaterialAssigner.cpp - Material.cpp - MaterialGridHelper.cpp - MaterialInteractionAssignment.cpp - MaterialMapUtils.cpp - MaterialMapper.cpp - MaterialSlab.cpp - MaterialValidater.cpp - ProtoVolumeMaterial.cpp - SurfaceMaterialMapper.cpp - VolumeMaterialMapper.cpp + ActsCore + PRIVATE + AccumulatedMaterialSlab.cpp + AccumulatedSurfaceMaterial.cpp + AccumulatedVolumeMaterial.cpp + AverageMaterials.cpp + BinnedSurfaceMaterial.cpp + BinnedSurfaceMaterialAccumulater.cpp + HomogeneousSurfaceMaterial.cpp + HomogeneousVolumeMaterial.cpp + Interactions.cpp + IntersectionMaterialAssigner.cpp + Material.cpp + MaterialGridHelper.cpp + MaterialInteractionAssignment.cpp + MaterialMapUtils.cpp + MaterialMapper.cpp + MaterialSlab.cpp + MaterialValidater.cpp + ProtoVolumeMaterial.cpp + SurfaceMaterialMapper.cpp + VolumeMaterialMapper.cpp ) diff --git a/Core/src/Propagator/CMakeLists.txt b/Core/src/Propagator/CMakeLists.txt index 6643438df21..b179a33e3c2 100644 --- a/Core/src/Propagator/CMakeLists.txt +++ b/Core/src/Propagator/CMakeLists.txt @@ -1,14 +1,14 @@ target_sources( - ActsCore - PRIVATE - EigenStepperError.cpp - MultiStepperError.cpp - SympyStepper.cpp - PropagatorError.cpp - StraightLineStepper.cpp - detail/PointwiseMaterialInteraction.cpp - detail/CovarianceEngine.cpp - detail/JacobianEngine.cpp - detail/SympyCovarianceEngine.cpp - detail/SympyJacobianEngine.cpp + ActsCore + PRIVATE + EigenStepperError.cpp + MultiStepperError.cpp + SympyStepper.cpp + PropagatorError.cpp + StraightLineStepper.cpp + detail/PointwiseMaterialInteraction.cpp + detail/CovarianceEngine.cpp + detail/JacobianEngine.cpp + detail/SympyCovarianceEngine.cpp + detail/SympyJacobianEngine.cpp ) diff --git a/Core/src/Surfaces/CMakeLists.txt b/Core/src/Surfaces/CMakeLists.txt index da8d198c407..2f704f595c6 100644 --- a/Core/src/Surfaces/CMakeLists.txt +++ b/Core/src/Surfaces/CMakeLists.txt @@ -1,33 +1,33 @@ target_sources( - ActsCore - PRIVATE - AnnulusBounds.cpp - BoundaryTolerance.cpp - ConeBounds.cpp - ConeSurface.cpp - ConvexPolygonBounds.cpp - CylinderBounds.cpp - CylinderSurface.cpp - DiamondBounds.cpp - DiscSurface.cpp - DiscTrapezoidBounds.cpp - EllipseBounds.cpp - IntersectionHelper2D.cpp - LineBounds.cpp - LineSurface.cpp - PerigeeSurface.cpp - PlaneSurface.cpp - RadialBounds.cpp - RectangleBounds.cpp - StrawSurface.cpp - Surface.cpp - SurfaceArray.cpp - SurfaceError.cpp - TrapezoidBounds.cpp - VerticesHelper.cpp - RegularSurface.cpp - CurvilinearSurface.cpp - detail/AlignmentHelper.cpp - detail/AnnulusBoundsHelper.cpp - detail/MergeHelper.cpp + ActsCore + PRIVATE + AnnulusBounds.cpp + BoundaryTolerance.cpp + ConeBounds.cpp + ConeSurface.cpp + ConvexPolygonBounds.cpp + CylinderBounds.cpp + CylinderSurface.cpp + DiamondBounds.cpp + DiscSurface.cpp + DiscTrapezoidBounds.cpp + EllipseBounds.cpp + IntersectionHelper2D.cpp + LineBounds.cpp + LineSurface.cpp + PerigeeSurface.cpp + PlaneSurface.cpp + RadialBounds.cpp + RectangleBounds.cpp + StrawSurface.cpp + Surface.cpp + SurfaceArray.cpp + SurfaceError.cpp + TrapezoidBounds.cpp + VerticesHelper.cpp + RegularSurface.cpp + CurvilinearSurface.cpp + detail/AlignmentHelper.cpp + detail/AnnulusBoundsHelper.cpp + detail/MergeHelper.cpp ) diff --git a/Core/src/TrackFinding/CMakeLists.txt b/Core/src/TrackFinding/CMakeLists.txt index de56fca703e..6033a160742 100644 --- a/Core/src/TrackFinding/CMakeLists.txt +++ b/Core/src/TrackFinding/CMakeLists.txt @@ -1,9 +1,9 @@ target_sources( - ActsCore - PRIVATE - CombinatorialKalmanFilterError.cpp - MeasurementSelector.cpp - GbtsConnector.cpp - RoiDescriptor.cpp - AmbiguityTrackClustering.cpp + ActsCore + PRIVATE + CombinatorialKalmanFilterError.cpp + MeasurementSelector.cpp + GbtsConnector.cpp + RoiDescriptor.cpp + AmbiguityTrackClustering.cpp ) diff --git a/Core/src/TrackFitting/CMakeLists.txt b/Core/src/TrackFitting/CMakeLists.txt index 04ccbf3559e..7f5c94d922e 100644 --- a/Core/src/TrackFitting/CMakeLists.txt +++ b/Core/src/TrackFitting/CMakeLists.txt @@ -1,32 +1,30 @@ target_sources( - ActsCore - PRIVATE - KalmanFitterError.cpp - GainMatrixUpdater.cpp - GainMatrixSmoother.cpp - GlobalChiSquareFitterError.cpp - GsfError.cpp - GsfUtils.cpp - BetheHeitlerApprox.cpp - GsfMixtureReduction.cpp - GlobalChiSquareFitter.cpp - MbfSmoother.cpp + ActsCore + PRIVATE + KalmanFitterError.cpp + GainMatrixUpdater.cpp + GainMatrixSmoother.cpp + GlobalChiSquareFitterError.cpp + GsfError.cpp + GsfUtils.cpp + BetheHeitlerApprox.cpp + GsfMixtureReduction.cpp + GlobalChiSquareFitter.cpp + MbfSmoother.cpp ) foreach(DIM RANGE 1 6) + set(dim_file ${CMAKE_CURRENT_BINARY_DIR}/GainMatrixUpdaterImpl${DIM}.cpp) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/GainMatrixUpdaterImpl.cpp.in + ${dim_file} + @ONLY + ) - set(dim_file ${CMAKE_CURRENT_BINARY_DIR}/GainMatrixUpdaterImpl${DIM}.cpp) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/GainMatrixUpdaterImpl.cpp.in - ${dim_file} - @ONLY - ) - - set_source_files_properties( - ${dim_file} - PROPERTIES COMPILE_DEFINITIONS ACTS_GAIN_MATRIX_UPDATER_INSTANTIATE=${DIM}) - target_sources(ActsCore - PRIVATE - ${dim_file}) - + set_source_files_properties( + ${dim_file} + PROPERTIES + COMPILE_DEFINITIONS ACTS_GAIN_MATRIX_UPDATER_INSTANTIATE=${DIM} + ) + target_sources(ActsCore PRIVATE ${dim_file}) endforeach() diff --git a/Core/src/Utilities/CMakeLists.txt b/Core/src/Utilities/CMakeLists.txt index 17d0492d51e..be3a4f83dfe 100644 --- a/Core/src/Utilities/CMakeLists.txt +++ b/Core/src/Utilities/CMakeLists.txt @@ -1,11 +1,11 @@ target_sources( - ActsCore - PRIVATE - AnnealingUtility.cpp - BinUtility.cpp - Logger.cpp - SpacePointUtility.cpp - TrackHelpers.cpp - BinningType.cpp - Intersection.cpp + ActsCore + PRIVATE + AnnealingUtility.cpp + BinUtility.cpp + Logger.cpp + SpacePointUtility.cpp + TrackHelpers.cpp + BinningType.cpp + Intersection.cpp ) diff --git a/Core/src/Vertexing/CMakeLists.txt b/Core/src/Vertexing/CMakeLists.txt index d0e8caa3c74..cf977ff0765 100644 --- a/Core/src/Vertexing/CMakeLists.txt +++ b/Core/src/Vertexing/CMakeLists.txt @@ -1,24 +1,24 @@ target_sources( - ActsCore - PRIVATE - AdaptiveGridTrackDensity.cpp - KalmanVertexUpdater.cpp - KalmanVertexUpdaterImpl3.cpp - KalmanVertexUpdaterImpl4.cpp - FsmwMode1dFinder.cpp - VertexingError.cpp - IterativeVertexFinder.cpp - AdaptiveMultiVertexFitter.cpp - AdaptiveGridDensityVertexFinder.cpp - ZScanVertexFinder.cpp - HelicalTrackLinearizer.cpp - FullBilloirVertexFitter.cpp - AdaptiveMultiVertexFinder.cpp - Vertex.cpp - NumericalTrackLinearizer.cpp - TrackDensityVertexFinder.cpp - GaussianTrackDensity.cpp - ImpactPointEstimator.cpp - GaussianGridTrackDensity.cpp - GridDensityVertexFinder.cpp + ActsCore + PRIVATE + AdaptiveGridTrackDensity.cpp + KalmanVertexUpdater.cpp + KalmanVertexUpdaterImpl3.cpp + KalmanVertexUpdaterImpl4.cpp + FsmwMode1dFinder.cpp + VertexingError.cpp + IterativeVertexFinder.cpp + AdaptiveMultiVertexFitter.cpp + AdaptiveGridDensityVertexFinder.cpp + ZScanVertexFinder.cpp + HelicalTrackLinearizer.cpp + FullBilloirVertexFitter.cpp + AdaptiveMultiVertexFinder.cpp + Vertex.cpp + NumericalTrackLinearizer.cpp + TrackDensityVertexFinder.cpp + GaussianTrackDensity.cpp + ImpactPointEstimator.cpp + GaussianGridTrackDensity.cpp + GridDensityVertexFinder.cpp ) diff --git a/Core/src/Visualization/CMakeLists.txt b/Core/src/Visualization/CMakeLists.txt index d838e6e2058..ea2bd2427e6 100644 --- a/Core/src/Visualization/CMakeLists.txt +++ b/Core/src/Visualization/CMakeLists.txt @@ -1,7 +1,4 @@ target_sources( - ActsCore - PRIVATE - IVisualization3D.cpp - GeometryView3D.cpp - EventDataView3D.cpp + ActsCore + PRIVATE IVisualization3D.cpp GeometryView3D.cpp EventDataView3D.cpp ) diff --git a/Examples/Algorithms/Alignment/CMakeLists.txt b/Examples/Algorithms/Alignment/CMakeLists.txt index 59c7b1d9a08..992efd9e1bb 100644 --- a/Examples/Algorithms/Alignment/CMakeLists.txt +++ b/Examples/Algorithms/Alignment/CMakeLists.txt @@ -1,16 +1,23 @@ add_library( - ActsExamplesAlignment SHARED - src/AlignmentAlgorithm.cpp - src/AlignmentAlgorithmFunction.cpp) + ActsExamplesAlignment + SHARED + src/AlignmentAlgorithm.cpp + src/AlignmentAlgorithmFunction.cpp +) target_include_directories( - ActsExamplesAlignment - PUBLIC $) + ActsExamplesAlignment + PUBLIC $ +) target_link_libraries( - ActsExamplesAlignment - PUBLIC - ActsCore ActsAlignment - ActsExamplesFramework ActsExamplesMagneticField) + ActsExamplesAlignment + PUBLIC + ActsCore + ActsAlignment + ActsExamplesFramework + ActsExamplesMagneticField +) install( - TARGETS ActsExamplesAlignment - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesAlignment + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Algorithms/AmbiguityResolution/CMakeLists.txt b/Examples/Algorithms/AmbiguityResolution/CMakeLists.txt index de338ec8fb3..2027a45079d 100644 --- a/Examples/Algorithms/AmbiguityResolution/CMakeLists.txt +++ b/Examples/Algorithms/AmbiguityResolution/CMakeLists.txt @@ -1,23 +1,21 @@ add_library( - ActsExamplesAmbiguityResolution SHARED - src/GreedyAmbiguityResolutionAlgorithm.cpp - src/ScoreBasedAmbiguityResolutionAlgorithm.cpp + ActsExamplesAmbiguityResolution + SHARED + src/GreedyAmbiguityResolutionAlgorithm.cpp + src/ScoreBasedAmbiguityResolutionAlgorithm.cpp ) target_include_directories( - ActsExamplesAmbiguityResolution - PUBLIC $ + ActsExamplesAmbiguityResolution + PUBLIC $ ) target_link_libraries( - ActsExamplesAmbiguityResolution - PUBLIC - ActsCore - ActsExamplesFramework - ActsPluginJson + ActsExamplesAmbiguityResolution + PUBLIC ActsCore ActsExamplesFramework ActsPluginJson ) install( - TARGETS ActsExamplesAmbiguityResolution - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + TARGETS ActsExamplesAmbiguityResolution + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/Examples/Algorithms/Digitization/CMakeLists.txt b/Examples/Algorithms/Digitization/CMakeLists.txt index 7590d85c06b..14729f2784f 100644 --- a/Examples/Algorithms/Digitization/CMakeLists.txt +++ b/Examples/Algorithms/Digitization/CMakeLists.txt @@ -1,18 +1,22 @@ add_library( - ActsExamplesDigitization SHARED - src/DigitizationAlgorithm.cpp - src/DigitizationConfig.cpp - src/MeasurementCreation.cpp - src/DigitizationConfigurator.cpp - src/ModuleClusters.cpp) + ActsExamplesDigitization + SHARED + src/DigitizationAlgorithm.cpp + src/DigitizationConfig.cpp + src/MeasurementCreation.cpp + src/DigitizationConfigurator.cpp + src/ModuleClusters.cpp +) target_include_directories( - ActsExamplesDigitization - PUBLIC $) + ActsExamplesDigitization + PUBLIC $ +) target_link_libraries( - ActsExamplesDigitization - PUBLIC - ActsCore ActsExamplesFramework) + ActsExamplesDigitization + PUBLIC ActsCore ActsExamplesFramework +) install( - TARGETS ActsExamplesDigitization - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesDigitization + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Algorithms/Fatras/CMakeLists.txt b/Examples/Algorithms/Fatras/CMakeLists.txt index 69bcd9cac2d..922414440d9 100644 --- a/Examples/Algorithms/Fatras/CMakeLists.txt +++ b/Examples/Algorithms/Fatras/CMakeLists.txt @@ -1,15 +1,11 @@ -add_library( - ActsExamplesFatras SHARED - src/FatrasSimulation.cpp) +add_library(ActsExamplesFatras SHARED src/FatrasSimulation.cpp) target_include_directories( - ActsExamplesFatras - PUBLIC $) + ActsExamplesFatras + PUBLIC $ +) target_link_libraries( - ActsExamplesFatras - PUBLIC - ActsCore ActsFatras - ActsExamplesFramework ActsExamplesMagneticField) + ActsExamplesFatras + PUBLIC ActsCore ActsFatras ActsExamplesFramework ActsExamplesMagneticField +) -install( - TARGETS ActsExamplesFatras - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS ActsExamplesFatras LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/Examples/Algorithms/Geant4/CMakeLists.txt b/Examples/Algorithms/Geant4/CMakeLists.txt index efa5d2280b7..a7dd786bccf 100644 --- a/Examples/Algorithms/Geant4/CMakeLists.txt +++ b/Examples/Algorithms/Geant4/CMakeLists.txt @@ -1,5 +1,6 @@ add_library( - ActsExamplesGeant4 SHARED + ActsExamplesGeant4 + SHARED src/GdmlDetectorConstruction.cpp src/TelescopeG4DetectorConstruction.cpp src/Geant4Simulation.cpp @@ -13,49 +14,61 @@ add_library( src/SimParticleTranslation.cpp src/ParticleKillAction.cpp src/PhysicsListFactory.cpp - src/Geant4Manager.cpp) + src/Geant4Manager.cpp +) -target_compile_definitions( - ActsExamplesGeant4 - PUBLIC ${Geant4_DEFINITIONS}) -target_include_directories( - ActsExamplesGeant4 - SYSTEM PUBLIC ${Geant4_INCLUDE_DIRS}) +target_compile_definitions(ActsExamplesGeant4 PUBLIC ${Geant4_DEFINITIONS}) target_include_directories( - ActsExamplesGeant4 - PUBLIC $) -target_link_libraries( - ActsExamplesGeant4 - PUBLIC ActsCore ActsExamplesFramework ActsExamplesDetectorTelescope Boost::headers ${Geant4_LIBRARIES}) - -if (ACTS_BUILD_EXAMPLES_DD4HEP) - if(${DD4hep_VERSION} VERSION_LESS 1.11) - target_include_directories( ActsExamplesGeant4 - PRIVATE ${DD4hep_INCLUDE_DIRS}) - target_link_libraries( + SYSTEM + PUBLIC ${Geant4_INCLUDE_DIRS} +) +target_include_directories( ActsExamplesGeant4 - PRIVATE ${DD4hep_DDCORE_LIBRARY} ${DD4hep_DDG4_LIBRARY}) - else() - target_link_libraries( + PUBLIC $ +) +target_link_libraries( ActsExamplesGeant4 - PUBLIC ActsExamplesDetectorDD4hep DD4hep::DDCore DD4hep::DDG4) - endif() + PUBLIC + ActsCore + ActsExamplesFramework + ActsExamplesDetectorTelescope + Boost::headers + ${Geant4_LIBRARIES} +) - target_sources(ActsExamplesGeant4 PUBLIC src/DDG4DetectorConstruction.cpp) -endif() +if(ACTS_BUILD_EXAMPLES_DD4HEP) + if(${DD4hep_VERSION} VERSION_LESS 1.11) + target_include_directories( + ActsExamplesGeant4 + PRIVATE ${DD4hep_INCLUDE_DIRS} + ) + target_link_libraries( + ActsExamplesGeant4 + PRIVATE ${DD4hep_DDCORE_LIBRARY} ${DD4hep_DDG4_LIBRARY} + ) + else() + target_link_libraries( + ActsExamplesGeant4 + PUBLIC ActsExamplesDetectorDD4hep DD4hep::DDCore DD4hep::DDG4 + ) + endif() -if (ACTS_BUILD_PLUGIN_GEOMODEL) + target_sources(ActsExamplesGeant4 PUBLIC src/DDG4DetectorConstruction.cpp) +endif() - target_sources(ActsExamplesGeant4 PUBLIC src/GeoModelDetectorConstruction.cpp) +if(ACTS_BUILD_PLUGIN_GEOMODEL) + target_sources( + ActsExamplesGeant4 + PUBLIC src/GeoModelDetectorConstruction.cpp + ) - find_library(GeoModel2G4_LIBRARY GeoModel2G4 REQUIRED) + find_library(GeoModel2G4_LIBRARY GeoModel2G4 REQUIRED) - target_link_libraries( - ActsExamplesGeant4 - PUBLIC ActsPluginGeoModel ${GeoModel2G4_LIBRARY}) + target_link_libraries( + ActsExamplesGeant4 + PUBLIC ActsPluginGeoModel ${GeoModel2G4_LIBRARY} + ) endif() -install( - TARGETS ActsExamplesGeant4 - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS ActsExamplesGeant4 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/Examples/Algorithms/Geant4HepMC/CMakeLists.txt b/Examples/Algorithms/Geant4HepMC/CMakeLists.txt index b2a4cd3cbf2..53e0f2a410b 100644 --- a/Examples/Algorithms/Geant4HepMC/CMakeLists.txt +++ b/Examples/Algorithms/Geant4HepMC/CMakeLists.txt @@ -1,20 +1,27 @@ add_library( - ActsExamplesEventRecording SHARED - src/EventAction.cpp - src/EventRecording.cpp - src/PrimaryGeneratorAction.cpp - src/RunAction.cpp - src/SteppingAction.cpp) + ActsExamplesEventRecording + SHARED + src/EventAction.cpp + src/EventRecording.cpp + src/PrimaryGeneratorAction.cpp + src/RunAction.cpp + src/SteppingAction.cpp +) target_include_directories( - ActsExamplesEventRecording - SYSTEM PUBLIC ${HEPMC3_INCLUDE_DIR}) + ActsExamplesEventRecording + SYSTEM + PUBLIC ${HEPMC3_INCLUDE_DIR} +) target_include_directories( - ActsExamplesEventRecording - PUBLIC $) + ActsExamplesEventRecording + PUBLIC $ +) target_link_libraries( - ActsExamplesEventRecording - PUBLIC ActsCore ActsExamplesFramework ActsExamplesGeant4 ${HEPMC3_LIBRARIES}) + ActsExamplesEventRecording + PUBLIC ActsCore ActsExamplesFramework ActsExamplesGeant4 ${HEPMC3_LIBRARIES} +) install( - TARGETS ActsExamplesEventRecording - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesEventRecording + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Algorithms/Generators/CMakeLists.txt b/Examples/Algorithms/Generators/CMakeLists.txt index 52c067f8ede..a7c1096cc19 100644 --- a/Examples/Algorithms/Generators/CMakeLists.txt +++ b/Examples/Algorithms/Generators/CMakeLists.txt @@ -1,14 +1,19 @@ add_library( - ActsExamplesGenerators SHARED - ActsExamples/Generators/EventGenerator.cpp - ActsExamples/Generators/ParametricParticleGenerator.cpp) + ActsExamplesGenerators + SHARED + ActsExamples/Generators/EventGenerator.cpp + ActsExamples/Generators/ParametricParticleGenerator.cpp +) target_include_directories( - ActsExamplesGenerators - PUBLIC $) + ActsExamplesGenerators + PUBLIC $ +) target_link_libraries( - ActsExamplesGenerators - PUBLIC ActsCore ActsExamplesFramework) + ActsExamplesGenerators + PUBLIC ActsCore ActsExamplesFramework +) install( - TARGETS ActsExamplesGenerators - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesGenerators + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Algorithms/GeneratorsPythia8/CMakeLists.txt b/Examples/Algorithms/GeneratorsPythia8/CMakeLists.txt index 29e4c3b86fa..bba231291be 100644 --- a/Examples/Algorithms/GeneratorsPythia8/CMakeLists.txt +++ b/Examples/Algorithms/GeneratorsPythia8/CMakeLists.txt @@ -1,17 +1,19 @@ add_library( - ActsExamplesGeneratorsPythia8 SHARED - ActsExamples/Generators/Pythia8ProcessGenerator.cpp) + ActsExamplesGeneratorsPythia8 + SHARED + ActsExamples/Generators/Pythia8ProcessGenerator.cpp +) target_include_directories( - ActsExamplesGeneratorsPythia8 - PUBLIC $) + ActsExamplesGeneratorsPythia8 + PUBLIC $ +) target_link_libraries( - ActsExamplesGeneratorsPythia8 - PUBLIC - ActsCore - ActsExamplesFramework ActsExamplesGenerators - PRIVATE - Pythia8) + ActsExamplesGeneratorsPythia8 + PUBLIC ActsCore ActsExamplesFramework ActsExamplesGenerators + PRIVATE Pythia8 +) install( - TARGETS ActsExamplesGeneratorsPythia8 - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesGeneratorsPythia8 + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Algorithms/Geometry/CMakeLists.txt b/Examples/Algorithms/Geometry/CMakeLists.txt index a82e0c1e885..ddf97691ac2 100644 --- a/Examples/Algorithms/Geometry/CMakeLists.txt +++ b/Examples/Algorithms/Geometry/CMakeLists.txt @@ -1,14 +1,16 @@ -add_library(ActsExamplesGeometry SHARED - src/VolumeAssociationTest.cpp) +add_library(ActsExamplesGeometry SHARED src/VolumeAssociationTest.cpp) target_include_directories( ActsExamplesGeometry - PUBLIC $) + PUBLIC $ +) target_link_libraries( ActsExamplesGeometry - PUBLIC ActsCore ActsExamplesFramework) + PUBLIC ActsCore ActsExamplesFramework +) install( - TARGETS ActsExamplesGeometry - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesGeometry + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Algorithms/HepMC/CMakeLists.txt b/Examples/Algorithms/HepMC/CMakeLists.txt index 74cb5e3e4e9..aeaab151c77 100644 --- a/Examples/Algorithms/HepMC/CMakeLists.txt +++ b/Examples/Algorithms/HepMC/CMakeLists.txt @@ -1,16 +1,16 @@ -add_library( - ActsExamplesHepMC3 SHARED - src/HepMCProcessExtractor.cpp) +add_library(ActsExamplesHepMC3 SHARED src/HepMCProcessExtractor.cpp) target_include_directories( - ActsExamplesHepMC3 - SYSTEM PUBLIC ${HEPMC3_INCLUDE_DIR}) + ActsExamplesHepMC3 + SYSTEM + PUBLIC ${HEPMC3_INCLUDE_DIR} +) target_include_directories( - ActsExamplesHepMC3 - PUBLIC $) + ActsExamplesHepMC3 + PUBLIC $ +) target_link_libraries( - ActsExamplesHepMC3 - PUBLIC ActsCore ActsExamplesFramework ActsExamplesIoHepMC3) + ActsExamplesHepMC3 + PUBLIC ActsCore ActsExamplesFramework ActsExamplesIoHepMC3 +) -install( - TARGETS ActsExamplesHepMC3 - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS ActsExamplesHepMC3 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/Examples/Algorithms/MaterialMapping/CMakeLists.txt b/Examples/Algorithms/MaterialMapping/CMakeLists.txt index 11d65602e4d..ac2bd9c5d0e 100644 --- a/Examples/Algorithms/MaterialMapping/CMakeLists.txt +++ b/Examples/Algorithms/MaterialMapping/CMakeLists.txt @@ -1,16 +1,21 @@ add_library( - ActsExamplesMaterialMapping SHARED - src/CoreMaterialMapping.cpp - src/MaterialValidation.cpp - src/MaterialMapping.cpp) + ActsExamplesMaterialMapping + SHARED + src/CoreMaterialMapping.cpp + src/MaterialValidation.cpp + src/MaterialMapping.cpp +) target_include_directories( - ActsExamplesMaterialMapping - PUBLIC $) + ActsExamplesMaterialMapping + PUBLIC $ +) target_link_libraries( - ActsExamplesMaterialMapping - PUBLIC ActsCore ActsExamplesFramework) + ActsExamplesMaterialMapping + PUBLIC ActsCore ActsExamplesFramework +) install( - TARGETS ActsExamplesMaterialMapping - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesMaterialMapping + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Algorithms/Printers/CMakeLists.txt b/Examples/Algorithms/Printers/CMakeLists.txt index 5d8a50b444e..4131c04bb84 100644 --- a/Examples/Algorithms/Printers/CMakeLists.txt +++ b/Examples/Algorithms/Printers/CMakeLists.txt @@ -1,14 +1,19 @@ add_library( - ActsExamplesPrinters SHARED - ActsExamples/Printers/ParticlesPrinter.cpp - ActsExamples/Printers/TrackParametersPrinter.cpp) + ActsExamplesPrinters + SHARED + ActsExamples/Printers/ParticlesPrinter.cpp + ActsExamples/Printers/TrackParametersPrinter.cpp +) target_include_directories( - ActsExamplesPrinters - PUBLIC $) + ActsExamplesPrinters + PUBLIC $ +) target_link_libraries( - ActsExamplesPrinters - PUBLIC ActsCore ActsFatras ActsExamplesFramework) + ActsExamplesPrinters + PUBLIC ActsCore ActsFatras ActsExamplesFramework +) install( - TARGETS ActsExamplesPrinters - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesPrinters + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Algorithms/Propagation/CMakeLists.txt b/Examples/Algorithms/Propagation/CMakeLists.txt index 18dcaf30963..c9b2b68ca36 100644 --- a/Examples/Algorithms/Propagation/CMakeLists.txt +++ b/Examples/Algorithms/Propagation/CMakeLists.txt @@ -1,14 +1,16 @@ -add_library(ActsExamplesPropagation SHARED - src/PropagationAlgorithm.cpp) +add_library(ActsExamplesPropagation SHARED src/PropagationAlgorithm.cpp) target_include_directories( - ActsExamplesPropagation - PUBLIC $) + ActsExamplesPropagation + PUBLIC $ +) target_link_libraries( - ActsExamplesPropagation - PUBLIC ActsCore ActsExamplesFramework) + ActsExamplesPropagation + PUBLIC ActsCore ActsExamplesFramework +) install( - TARGETS ActsExamplesPropagation - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesPropagation + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Algorithms/TrackFinding/CMakeLists.txt b/Examples/Algorithms/TrackFinding/CMakeLists.txt index be962b242cf..d030529d18c 100644 --- a/Examples/Algorithms/TrackFinding/CMakeLists.txt +++ b/Examples/Algorithms/TrackFinding/CMakeLists.txt @@ -1,33 +1,33 @@ add_library( - ActsExamplesTrackFinding SHARED - src/SeedingAlgorithm.cpp - src/SeedingOrthogonalAlgorithm.cpp - src/SpacePointMaker.cpp - src/TrackFindingAlgorithm.cpp - src/TrackFindingAlgorithmFunction.cpp - src/HoughTransformSeeder.cpp - src/TrackParamsEstimationAlgorithm.cpp - src/MuonHoughSeeder.cpp - src/GbtsSeedingAlgorithm.cpp + ActsExamplesTrackFinding + SHARED + src/SeedingAlgorithm.cpp + src/SeedingOrthogonalAlgorithm.cpp + src/SpacePointMaker.cpp + src/TrackFindingAlgorithm.cpp + src/TrackFindingAlgorithmFunction.cpp + src/HoughTransformSeeder.cpp + src/TrackParamsEstimationAlgorithm.cpp + src/MuonHoughSeeder.cpp + src/GbtsSeedingAlgorithm.cpp ) target_include_directories( - ActsExamplesTrackFinding - PUBLIC $ + ActsExamplesTrackFinding + PUBLIC $ ) target_link_libraries( - ActsExamplesTrackFinding - PUBLIC - ActsCore - ActsExamplesFramework - ActsExamplesIoJson - ActsExamplesMagneticField - - PRIVATE ROOT::Core ROOT::Geom ROOT::Graf ROOT::Hist ROOT::Gpad + ActsExamplesTrackFinding + PUBLIC + ActsCore + ActsExamplesFramework + ActsExamplesIoJson + ActsExamplesMagneticField + PRIVATE ROOT::Core ROOT::Geom ROOT::Graf ROOT::Hist ROOT::Gpad ) install( - TARGETS ActsExamplesTrackFinding - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + TARGETS ActsExamplesTrackFinding + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/Examples/Algorithms/TrackFindingExaTrkX/CMakeLists.txt b/Examples/Algorithms/TrackFindingExaTrkX/CMakeLists.txt index 5b7ea5e820e..85866466ec6 100644 --- a/Examples/Algorithms/TrackFindingExaTrkX/CMakeLists.txt +++ b/Examples/Algorithms/TrackFindingExaTrkX/CMakeLists.txt @@ -1,25 +1,23 @@ add_library( - ActsExamplesTrackFindingExaTrkX SHARED - src/TrackFindingAlgorithmExaTrkX.cpp - src/PrototracksToParameters.cpp - src/TrackFindingFromPrototrackAlgorithm.cpp - src/TruthGraphBuilder.cpp + ActsExamplesTrackFindingExaTrkX + SHARED + src/TrackFindingAlgorithmExaTrkX.cpp + src/PrototracksToParameters.cpp + src/TrackFindingFromPrototrackAlgorithm.cpp + src/TruthGraphBuilder.cpp ) target_include_directories( - ActsExamplesTrackFindingExaTrkX - PUBLIC $ + ActsExamplesTrackFindingExaTrkX + PUBLIC $ ) target_link_libraries( - ActsExamplesTrackFindingExaTrkX - PUBLIC - ActsPluginExaTrkX - ActsExamplesFramework - ActsExamplesTrackFinding + ActsExamplesTrackFindingExaTrkX + PUBLIC ActsPluginExaTrkX ActsExamplesFramework ActsExamplesTrackFinding ) install( - TARGETS ActsExamplesTrackFindingExaTrkX - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + TARGETS ActsExamplesTrackFindingExaTrkX + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/Examples/Algorithms/TrackFindingML/CMakeLists.txt b/Examples/Algorithms/TrackFindingML/CMakeLists.txt index 90b9913efee..d826b224f2c 100644 --- a/Examples/Algorithms/TrackFindingML/CMakeLists.txt +++ b/Examples/Algorithms/TrackFindingML/CMakeLists.txt @@ -1,29 +1,23 @@ set(SOURCES - src/AmbiguityResolutionML.cpp - src/AmbiguityResolutionMLAlgorithm.cpp - src/AmbiguityResolutionMLDBScanAlgorithm.cpp - src/SeedFilterMLAlgorithm.cpp + src/AmbiguityResolutionML.cpp + src/AmbiguityResolutionMLAlgorithm.cpp + src/AmbiguityResolutionMLDBScanAlgorithm.cpp + src/SeedFilterMLAlgorithm.cpp ) -add_library( - ActsExamplesTrackFindingML SHARED - ${SOURCES} -) +add_library(ActsExamplesTrackFindingML SHARED ${SOURCES}) target_include_directories( - ActsExamplesTrackFindingML - PUBLIC $ + ActsExamplesTrackFindingML + PUBLIC $ ) target_link_libraries( - ActsExamplesTrackFindingML - PUBLIC - ActsCore - ActsPluginOnnx - ActsExamplesFramework + ActsExamplesTrackFindingML + PUBLIC ActsCore ActsPluginOnnx ActsExamplesFramework ) install( - TARGETS ActsExamplesTrackFindingML - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + TARGETS ActsExamplesTrackFindingML + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/Examples/Algorithms/TrackFitting/CMakeLists.txt b/Examples/Algorithms/TrackFitting/CMakeLists.txt index ca049947e51..07e26091384 100644 --- a/Examples/Algorithms/TrackFitting/CMakeLists.txt +++ b/Examples/Algorithms/TrackFitting/CMakeLists.txt @@ -1,21 +1,24 @@ add_library( - ActsExamplesTrackFitting SHARED - src/RefittingCalibrator.cpp - src/SurfaceSortingAlgorithm.cpp - src/TrackFittingAlgorithm.cpp - src/KalmanFitterFunction.cpp - src/RefittingAlgorithm.cpp - src/GsfFitterFunction.cpp - src/GlobalChiSquareFitterFunction.cpp) + ActsExamplesTrackFitting + SHARED + src/RefittingCalibrator.cpp + src/SurfaceSortingAlgorithm.cpp + src/TrackFittingAlgorithm.cpp + src/KalmanFitterFunction.cpp + src/RefittingAlgorithm.cpp + src/GsfFitterFunction.cpp + src/GlobalChiSquareFitterFunction.cpp +) target_include_directories( - ActsExamplesTrackFitting - PUBLIC $) + ActsExamplesTrackFitting + PUBLIC $ +) target_link_libraries( - ActsExamplesTrackFitting - PUBLIC - ActsCore - ActsExamplesFramework ActsExamplesMagneticField) + ActsExamplesTrackFitting + PUBLIC ActsCore ActsExamplesFramework ActsExamplesMagneticField +) install( - TARGETS ActsExamplesTrackFitting - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesTrackFitting + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Algorithms/TruthTracking/CMakeLists.txt b/Examples/Algorithms/TruthTracking/CMakeLists.txt index df9a5d6c36b..7c1eff1ed51 100644 --- a/Examples/Algorithms/TruthTracking/CMakeLists.txt +++ b/Examples/Algorithms/TruthTracking/CMakeLists.txt @@ -1,22 +1,26 @@ add_library( - ActsExamplesTruthTracking SHARED - ActsExamples/TruthTracking/ParticleSelector.cpp - ActsExamples/TruthTracking/ParticleSmearing.cpp - ActsExamples/TruthTracking/TrackParameterSelector.cpp - ActsExamples/TruthTracking/TrackModifier.cpp - ActsExamples/TruthTracking/TrackTruthMatcher.cpp - ActsExamples/TruthTracking/TruthSeedSelector.cpp - ActsExamples/TruthTracking/TruthTrackFinder.cpp - ActsExamples/TruthTracking/TruthVertexFinder.cpp - ActsExamples/TruthTracking/TruthSeedingAlgorithm.cpp + ActsExamplesTruthTracking + SHARED + ActsExamples/TruthTracking/ParticleSelector.cpp + ActsExamples/TruthTracking/ParticleSmearing.cpp + ActsExamples/TruthTracking/TrackParameterSelector.cpp + ActsExamples/TruthTracking/TrackModifier.cpp + ActsExamples/TruthTracking/TrackTruthMatcher.cpp + ActsExamples/TruthTracking/TruthSeedSelector.cpp + ActsExamples/TruthTracking/TruthTrackFinder.cpp + ActsExamples/TruthTracking/TruthVertexFinder.cpp + ActsExamples/TruthTracking/TruthSeedingAlgorithm.cpp ) target_include_directories( - ActsExamplesTruthTracking - PUBLIC $) + ActsExamplesTruthTracking + PUBLIC $ +) target_link_libraries( - ActsExamplesTruthTracking - PUBLIC ActsCore ActsExamplesFramework) + ActsExamplesTruthTracking + PUBLIC ActsCore ActsExamplesFramework +) install( - TARGETS ActsExamplesTruthTracking - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesTruthTracking + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Algorithms/Utilities/CMakeLists.txt b/Examples/Algorithms/Utilities/CMakeLists.txt index 82a314a699d..ba9419c1914 100644 --- a/Examples/Algorithms/Utilities/CMakeLists.txt +++ b/Examples/Algorithms/Utilities/CMakeLists.txt @@ -1,22 +1,25 @@ add_library( - ActsExamplesUtilities SHARED - src/PrototracksToSeeds.cpp - src/SeedsToPrototracks.cpp - src/TrajectoriesToPrototracks.cpp - src/TrackSelectorAlgorithm.cpp - src/TracksToTrajectories.cpp - src/PrototracksToTracks.cpp - src/HitSelector.cpp - src/TracksToParameters.cpp) + ActsExamplesUtilities + SHARED + src/PrototracksToSeeds.cpp + src/SeedsToPrototracks.cpp + src/TrajectoriesToPrototracks.cpp + src/TrackSelectorAlgorithm.cpp + src/TracksToTrajectories.cpp + src/PrototracksToTracks.cpp + src/HitSelector.cpp + src/TracksToParameters.cpp +) target_include_directories( - ActsExamplesUtilities - PUBLIC $) + ActsExamplesUtilities + PUBLIC $ +) target_link_libraries( - ActsExamplesUtilities - PUBLIC - ActsCore - ActsExamplesFramework) + ActsExamplesUtilities + PUBLIC ActsCore ActsExamplesFramework +) install( - TARGETS ActsExamplesUtilities - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesUtilities + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Algorithms/Vertexing/CMakeLists.txt b/Examples/Algorithms/Vertexing/CMakeLists.txt index b982e10bc26..131135543c5 100644 --- a/Examples/Algorithms/Vertexing/CMakeLists.txt +++ b/Examples/Algorithms/Vertexing/CMakeLists.txt @@ -1,19 +1,23 @@ add_library( - ActsExamplesVertexing SHARED - src/AdaptiveMultiVertexFinderAlgorithm.cpp - src/IterativeVertexFinderAlgorithm.cpp - src/VertexFitterAlgorithm.cpp - src/SingleSeedVertexFinderAlgorithm.cpp - src/TruthVertexSeeder.cpp + ActsExamplesVertexing + SHARED + src/AdaptiveMultiVertexFinderAlgorithm.cpp + src/IterativeVertexFinderAlgorithm.cpp + src/VertexFitterAlgorithm.cpp + src/SingleSeedVertexFinderAlgorithm.cpp + src/TruthVertexSeeder.cpp ) target_include_directories( - ActsExamplesVertexing - PUBLIC $) + ActsExamplesVertexing + PUBLIC $ +) target_link_libraries( - ActsExamplesVertexing - PUBLIC ActsCore ActsExamplesFramework - PRIVATE ActsExamplesTruthTracking) + ActsExamplesVertexing + PUBLIC ActsCore ActsExamplesFramework + PRIVATE ActsExamplesTruthTracking +) install( - TARGETS ActsExamplesVertexing - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesVertexing + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Detectors/ContextualDetector/CMakeLists.txt b/Examples/Detectors/ContextualDetector/CMakeLists.txt index 7ffc1394e8e..2cb61207c53 100644 --- a/Examples/Detectors/ContextualDetector/CMakeLists.txt +++ b/Examples/Detectors/ContextualDetector/CMakeLists.txt @@ -1,17 +1,20 @@ add_library( - ActsExamplesDetectorContextual SHARED - src/AlignedDetector.cpp - src/InternalAlignmentDecorator.cpp - src/ExternalAlignmentDecorator.cpp) + ActsExamplesDetectorContextual + SHARED + src/AlignedDetector.cpp + src/InternalAlignmentDecorator.cpp + src/ExternalAlignmentDecorator.cpp +) target_include_directories( - ActsExamplesDetectorContextual - PUBLIC $) + ActsExamplesDetectorContextual + PUBLIC $ +) target_link_libraries( - ActsExamplesDetectorContextual - PUBLIC - ActsCore - ActsExamplesFramework ActsExamplesDetectorGeneric) + ActsExamplesDetectorContextual + PUBLIC ActsCore ActsExamplesFramework ActsExamplesDetectorGeneric +) install( - TARGETS ActsExamplesDetectorContextual - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesDetectorContextual + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Detectors/DD4hepDetector/CMakeLists.txt b/Examples/Detectors/DD4hepDetector/CMakeLists.txt index 1a335363871..244b4f20a6d 100644 --- a/Examples/Detectors/DD4hepDetector/CMakeLists.txt +++ b/Examples/Detectors/DD4hepDetector/CMakeLists.txt @@ -1,31 +1,42 @@ add_library( - ActsExamplesDetectorDD4hep SHARED - src/DD4hepDetector.cpp - src/DD4hepGeometryService.cpp) + ActsExamplesDetectorDD4hep + SHARED + src/DD4hepDetector.cpp + src/DD4hepGeometryService.cpp +) target_include_directories( - ActsExamplesDetectorDD4hep - PUBLIC $) + ActsExamplesDetectorDD4hep + PUBLIC $ +) target_link_libraries( - ActsExamplesDetectorDD4hep - PUBLIC - ActsCore - ActsPluginDD4hep - ActsExamplesFramework) + ActsExamplesDetectorDD4hep + PUBLIC ActsCore ActsPluginDD4hep ActsExamplesFramework +) if(${DD4hep_VERSION} VERSION_LESS 1.11) - target_include_directories(ActsExamplesDetectorDD4hep PUBLIC ${DD4hep_INCLUDE_DIRS}) - target_link_libraries(ActsExamplesDetectorDD4hep PUBLIC ${DD4hep_DDCORE_LIBRARY}) + target_include_directories( + ActsExamplesDetectorDD4hep + PUBLIC ${DD4hep_INCLUDE_DIRS} + ) + target_link_libraries( + ActsExamplesDetectorDD4hep + PUBLIC ${DD4hep_DDCORE_LIBRARY} + ) else() - target_link_libraries(ActsExamplesDetectorDD4hep PUBLIC DD4hep::DDCore) + target_link_libraries(ActsExamplesDetectorDD4hep PUBLIC DD4hep::DDCore) endif() # not sure why this needs to be set, but dd4hep fails to compile otherwise set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) -set_target_properties(ActsExamplesDetectorDD4hep PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +set_target_properties( + ActsExamplesDetectorDD4hep + PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) dd4hep_set_version(ActsExamplesDetectorDD4hep MAJOR 1 MINOR 0 PATCH 0) dd4hep_generate_rootmap(ActsExamplesDetectorDD4hep) install( - TARGETS ActsExamplesDetectorDD4hep - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesDetectorDD4hep + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Detectors/Geant4Detector/CMakeLists.txt b/Examples/Detectors/Geant4Detector/CMakeLists.txt index 56b3b872930..8a83657de5a 100644 --- a/Examples/Detectors/Geant4Detector/CMakeLists.txt +++ b/Examples/Detectors/Geant4Detector/CMakeLists.txt @@ -1,14 +1,14 @@ -add_library( - ActsExamplesDetectorGeant4 SHARED - src/Geant4Detector.cpp - ) +add_library(ActsExamplesDetectorGeant4 SHARED src/Geant4Detector.cpp) target_include_directories( ActsExamplesDetectorGeant4 - PUBLIC $) + PUBLIC $ +) target_link_libraries( ActsExamplesDetectorGeant4 - PUBLIC ActsCore ActsExamplesFramework ActsExamplesGeant4 ActsPluginGeant4) + PUBLIC ActsCore ActsExamplesFramework ActsExamplesGeant4 ActsPluginGeant4 +) install( - TARGETS ActsExamplesDetectorGeant4 - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesDetectorGeant4 + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Detectors/GenericDetector/CMakeLists.txt b/Examples/Detectors/GenericDetector/CMakeLists.txt index 28614c7ae7b..242e710df42 100644 --- a/Examples/Detectors/GenericDetector/CMakeLists.txt +++ b/Examples/Detectors/GenericDetector/CMakeLists.txt @@ -1,18 +1,18 @@ add_library( - ActsExamplesDetectorGeneric SHARED - src/BuildGenericDetector.cpp - src/GenericDetector.cpp - src/GenericDetectorElement.cpp) + ActsExamplesDetectorGeneric + SHARED + src/BuildGenericDetector.cpp + src/GenericDetector.cpp + src/GenericDetectorElement.cpp +) target_include_directories( - ActsExamplesDetectorGeneric - PUBLIC $) -target_link_libraries( - ActsExamplesDetectorGeneric - PUBLIC ActsCore) -target_link_libraries( - ActsExamplesDetectorGeneric - PUBLIC ActsExamplesFramework) + ActsExamplesDetectorGeneric + PUBLIC $ +) +target_link_libraries(ActsExamplesDetectorGeneric PUBLIC ActsCore) +target_link_libraries(ActsExamplesDetectorGeneric PUBLIC ActsExamplesFramework) install( - TARGETS ActsExamplesDetectorGeneric - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesDetectorGeneric + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Detectors/MagneticField/CMakeLists.txt b/Examples/Detectors/MagneticField/CMakeLists.txt index 7e13b135650..b8eb5f9c326 100644 --- a/Examples/Detectors/MagneticField/CMakeLists.txt +++ b/Examples/Detectors/MagneticField/CMakeLists.txt @@ -1,18 +1,23 @@ add_library( - ActsExamplesMagneticField SHARED - src/FieldMapRootIo.cpp - src/FieldMapTextIo.cpp - src/ScalableBFieldService.cpp) + ActsExamplesMagneticField + SHARED + src/FieldMapRootIo.cpp + src/FieldMapTextIo.cpp + src/ScalableBFieldService.cpp +) target_include_directories( - ActsExamplesMagneticField - PUBLIC $) + ActsExamplesMagneticField + PUBLIC $ +) target_link_libraries( - ActsExamplesMagneticField - # the ROOT libraries should be private, but if we do that then the linker - # fails with some missing ROOT symbols. - PUBLIC ActsCore ActsExamplesFramework ROOT::Core ROOT::Tree - PRIVATE std::filesystem) + ActsExamplesMagneticField + # the ROOT libraries should be private, but if we do that then the linker + # fails with some missing ROOT symbols. + PUBLIC ActsCore ActsExamplesFramework ROOT::Core ROOT::Tree + PRIVATE std::filesystem +) install( - TARGETS ActsExamplesMagneticField - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesMagneticField + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Detectors/MuonSpectrometerMockupDetector/CMakeLists.txt b/Examples/Detectors/MuonSpectrometerMockupDetector/CMakeLists.txt index 9a5c02082ed..4e0850cc21f 100644 --- a/Examples/Detectors/MuonSpectrometerMockupDetector/CMakeLists.txt +++ b/Examples/Detectors/MuonSpectrometerMockupDetector/CMakeLists.txt @@ -1,13 +1,23 @@ add_library( - ActsExamplesMuonSpectrometerMockupDetector SHARED - src/MockupSectorBuilder.cpp) + ActsExamplesMuonSpectrometerMockupDetector + SHARED + src/MockupSectorBuilder.cpp +) target_include_directories( ActsExamplesMuonSpectrometerMockupDetector - PUBLIC $) + PUBLIC $ +) target_link_libraries( ActsExamplesMuonSpectrometerMockupDetector - PUBLIC ActsCore ActsExamplesFramework ActsExamplesGeant4 ActsExamplesDetectorGeant4 ActsPluginGeant4) + PUBLIC + ActsCore + ActsExamplesFramework + ActsExamplesGeant4 + ActsExamplesDetectorGeant4 + ActsPluginGeant4 +) install( - TARGETS ActsExamplesMuonSpectrometerMockupDetector - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesMuonSpectrometerMockupDetector + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Detectors/TGeoDetector/CMakeLists.txt b/Examples/Detectors/TGeoDetector/CMakeLists.txt index 6bb8967f0b7..04d065adaa5 100644 --- a/Examples/Detectors/TGeoDetector/CMakeLists.txt +++ b/Examples/Detectors/TGeoDetector/CMakeLists.txt @@ -1,21 +1,27 @@ add_library( - ActsExamplesDetectorTGeo SHARED - src/TGeoDetector.cpp - src/TGeoITkModuleSplitter.cpp) + ActsExamplesDetectorTGeo + SHARED + src/TGeoDetector.cpp + src/TGeoITkModuleSplitter.cpp +) target_include_directories( - ActsExamplesDetectorTGeo - PUBLIC $) + ActsExamplesDetectorTGeo + PUBLIC $ +) target_link_libraries( - ActsExamplesDetectorTGeo - PUBLIC - ActsCore ActsPluginTGeo ActsPluginJson - ActsExamplesFramework ActsExamplesDetectorGeneric) + ActsExamplesDetectorTGeo + PUBLIC + ActsCore + ActsPluginTGeo + ActsPluginJson + ActsExamplesFramework + ActsExamplesDetectorGeneric +) install( - TARGETS ActsExamplesDetectorTGeo - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesDetectorTGeo + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) -install( - DIRECTORY include/ActsExamples - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(DIRECTORY include/ActsExamples DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Examples/Detectors/TelescopeDetector/CMakeLists.txt b/Examples/Detectors/TelescopeDetector/CMakeLists.txt index 08acae480b6..9b41a082c42 100644 --- a/Examples/Detectors/TelescopeDetector/CMakeLists.txt +++ b/Examples/Detectors/TelescopeDetector/CMakeLists.txt @@ -1,15 +1,20 @@ add_library( - ActsExamplesDetectorTelescope SHARED - src/TelescopeDetector.cpp - src/TelescopeDetectorElement.cpp - src/BuildTelescopeDetector.cpp) + ActsExamplesDetectorTelescope + SHARED + src/TelescopeDetector.cpp + src/TelescopeDetectorElement.cpp + src/BuildTelescopeDetector.cpp +) target_include_directories( - ActsExamplesDetectorTelescope - PUBLIC $) + ActsExamplesDetectorTelescope + PUBLIC $ +) target_link_libraries( - ActsExamplesDetectorTelescope - PUBLIC ActsCore ActsExamplesFramework) + ActsExamplesDetectorTelescope + PUBLIC ActsCore ActsExamplesFramework +) install( - TARGETS ActsExamplesDetectorTelescope - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesDetectorTelescope + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Framework/CMakeLists.txt b/Examples/Framework/CMakeLists.txt index 49fa92a53cb..bfe33f2e8e6 100644 --- a/Examples/Framework/CMakeLists.txt +++ b/Examples/Framework/CMakeLists.txt @@ -2,69 +2,78 @@ include(ActsTargetLinkLibrariesSystem) set(ActsExamplesFramework_SOURCES) - add_library( - ActsExamplesFramework SHARED - src/EventData/MeasurementCalibration.cpp - src/EventData/ScalingCalibrator.cpp - src/Framework/IAlgorithm.cpp - src/Framework/SequenceElement.cpp - src/Framework/WhiteBoard.cpp - src/Framework/RandomNumbers.cpp - src/Framework/Sequencer.cpp - src/Utilities/EventDataTransforms.cpp - src/Utilities/Paths.cpp - src/Utilities/Options.cpp - src/Utilities/Helpers.cpp - src/Validation/DuplicationPlotTool.cpp - src/Validation/EffPlotTool.cpp - src/Validation/FakeRatePlotTool.cpp - src/Validation/ResPlotTool.cpp - src/Validation/TrackClassification.cpp - src/Validation/TrackSummaryPlotTool.cpp - ) + ActsExamplesFramework + SHARED + src/EventData/MeasurementCalibration.cpp + src/EventData/ScalingCalibrator.cpp + src/Framework/IAlgorithm.cpp + src/Framework/SequenceElement.cpp + src/Framework/WhiteBoard.cpp + src/Framework/RandomNumbers.cpp + src/Framework/Sequencer.cpp + src/Utilities/EventDataTransforms.cpp + src/Utilities/Paths.cpp + src/Utilities/Options.cpp + src/Utilities/Helpers.cpp + src/Validation/DuplicationPlotTool.cpp + src/Validation/EffPlotTool.cpp + src/Validation/FakeRatePlotTool.cpp + src/Validation/ResPlotTool.cpp + src/Validation/TrackClassification.cpp + src/Validation/TrackSummaryPlotTool.cpp +) target_include_directories( - ActsExamplesFramework - PUBLIC $) + ActsExamplesFramework + PUBLIC $ +) target_link_libraries( - ActsExamplesFramework - PUBLIC ActsCore ActsFatras ActsPluginFpeMonitoring Boost::boost ROOT::Core ROOT::Hist - PRIVATE std::filesystem) + ActsExamplesFramework + PUBLIC + ActsCore + ActsFatras + ActsPluginFpeMonitoring + Boost::boost + ROOT::Core + ROOT::Hist + PRIVATE std::filesystem +) target_compile_definitions( - ActsExamplesFramework - PRIVATE BOOST_FILESYSTEM_NO_DEPRECATED) + ActsExamplesFramework + PRIVATE BOOST_FILESYSTEM_NO_DEPRECATED +) if(ACTS_USE_EXAMPLES_TBB) - # newer DD4hep version require TBB and search internally for TBB in - # config-only mode. to avoid mismatches we explicitly search using - # config-only mode first to be sure that we find the same version. - find_package(TBB ${_acts_tbb_version} CONFIG) - if(NOT TBB_FOUND) - # no version check possible when using the find module - find_package(TBB ${_acts_tbb_version} MODULE) - endif() + # newer DD4hep version require TBB and search internally for TBB in + # config-only mode. to avoid mismatches we explicitly search using + # config-only mode first to be sure that we find the same version. + find_package(TBB ${_acts_tbb_version} CONFIG) + if(NOT TBB_FOUND) + # no version check possible when using the find module + find_package(TBB ${_acts_tbb_version} MODULE) + endif() else() - set(TBB_FOUND FALSE) + set(TBB_FOUND FALSE) endif() if(TBB_FOUND) - target_link_libraries( - ActsExamplesFramework - PUBLIC TBB::tbb) + target_link_libraries(ActsExamplesFramework PUBLIC TBB::tbb) else() - message(STATUS "disable TBB for Examples/Framework - only single-threaded running will be supported") - target_compile_definitions( - ActsExamplesFramework - PUBLIC - -DACTS_EXAMPLES_NO_TBB) + message( + STATUS + "disable TBB for Examples/Framework - only single-threaded running will be supported" + ) + target_compile_definitions( + ActsExamplesFramework + PUBLIC -DACTS_EXAMPLES_NO_TBB + ) endif() install( - TARGETS ActsExamplesFramework - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesFramework + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) -install( - DIRECTORY include/ActsExamples - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(DIRECTORY include/ActsExamples DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) add_subdirectory_if(ML ACTS_BUILD_PLUGIN_ONNX) diff --git a/Examples/Framework/ML/CMakeLists.txt b/Examples/Framework/ML/CMakeLists.txt index bd574de9fa6..ab50cbb6f4a 100644 --- a/Examples/Framework/ML/CMakeLists.txt +++ b/Examples/Framework/ML/CMakeLists.txt @@ -1,21 +1,18 @@ -add_library( - ActsExamplesFrameworkML SHARED - src/NeuralCalibrator.cpp - ) +add_library(ActsExamplesFrameworkML SHARED src/NeuralCalibrator.cpp) target_include_directories( - ActsExamplesFrameworkML - PUBLIC $) + ActsExamplesFrameworkML + PUBLIC $ +) target_link_libraries( - ActsExamplesFrameworkML - PUBLIC ActsExamplesFramework ActsPluginOnnx - ) + ActsExamplesFrameworkML + PUBLIC ActsExamplesFramework ActsPluginOnnx +) install( - TARGETS ActsExamplesFrameworkML - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesFrameworkML + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) -install( - DIRECTORY include/ActsExamples - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(DIRECTORY include/ActsExamples DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Examples/HelloWorld/CMakeLists.txt b/Examples/HelloWorld/CMakeLists.txt index ab8a087463c..738ded22a99 100644 --- a/Examples/HelloWorld/CMakeLists.txt +++ b/Examples/HelloWorld/CMakeLists.txt @@ -1,15 +1,16 @@ add_executable( - ActsExampleHelloWorld - HelloWorld.cpp - HelloLoggerAlgorithm.cpp - HelloRandomAlgorithm.cpp - HelloWhiteBoardAlgorithm.cpp) + ActsExampleHelloWorld + HelloWorld.cpp + HelloLoggerAlgorithm.cpp + HelloRandomAlgorithm.cpp + HelloWhiteBoardAlgorithm.cpp +) target_link_libraries( - ActsExampleHelloWorld - PRIVATE - ActsCore - ActsExamplesFramework) + ActsExampleHelloWorld + PRIVATE ActsCore ActsExamplesFramework +) install( - TARGETS ActsExampleHelloWorld - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + TARGETS ActsExampleHelloWorld + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/Examples/Io/Csv/CMakeLists.txt b/Examples/Io/Csv/CMakeLists.txt index 3cb9919f405..e252bd95fe7 100644 --- a/Examples/Io/Csv/CMakeLists.txt +++ b/Examples/Io/Csv/CMakeLists.txt @@ -1,36 +1,39 @@ include(ActsTargetLinkLibrariesSystem) add_library( - ActsExamplesIoCsv SHARED - src/CsvMeasurementReader.cpp - src/CsvMeasurementWriter.cpp - src/CsvParticleReader.cpp - src/CsvParticleWriter.cpp - src/CsvSimHitReader.cpp - src/CsvSimHitWriter.cpp - src/CsvSpacePointReader.cpp - src/CsvTrackingGeometryWriter.cpp - src/CsvTrackParameterReader.cpp - src/CsvTrackParameterWriter.cpp - src/CsvSeedWriter.cpp - src/CsvTrackWriter.cpp - src/CsvDriftCircleReader.cpp - src/CsvMuonSimHitReader.cpp - src/CsvProtoTrackWriter.cpp - src/CsvSpacePointWriter.cpp - src/CsvExaTrkXGraphWriter.cpp - src/CsvExaTrkXGraphReader.cpp - src/CsvBFieldWriter.cpp) + ActsExamplesIoCsv + SHARED + src/CsvMeasurementReader.cpp + src/CsvMeasurementWriter.cpp + src/CsvParticleReader.cpp + src/CsvParticleWriter.cpp + src/CsvSimHitReader.cpp + src/CsvSimHitWriter.cpp + src/CsvSpacePointReader.cpp + src/CsvTrackingGeometryWriter.cpp + src/CsvTrackParameterReader.cpp + src/CsvTrackParameterWriter.cpp + src/CsvSeedWriter.cpp + src/CsvTrackWriter.cpp + src/CsvDriftCircleReader.cpp + src/CsvMuonSimHitReader.cpp + src/CsvProtoTrackWriter.cpp + src/CsvSpacePointWriter.cpp + src/CsvExaTrkXGraphWriter.cpp + src/CsvExaTrkXGraphReader.cpp + src/CsvBFieldWriter.cpp +) target_include_directories( - ActsExamplesIoCsv - PUBLIC $) + ActsExamplesIoCsv + PUBLIC $ +) target_link_libraries( - ActsExamplesIoCsv - PRIVATE - ActsCore - ActsExamplesFramework ActsExamplesDigitization - Threads::Threads) + ActsExamplesIoCsv + PRIVATE + ActsCore + ActsExamplesFramework + ActsExamplesDigitization + Threads::Threads +) -install( - TARGETS ActsExamplesIoCsv - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS ActsExamplesIoCsv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/Examples/Io/EDM4hep/CMakeLists.txt b/Examples/Io/EDM4hep/CMakeLists.txt index 9f7ddf37057..2d48bae21bd 100644 --- a/Examples/Io/EDM4hep/CMakeLists.txt +++ b/Examples/Io/EDM4hep/CMakeLists.txt @@ -1,29 +1,34 @@ add_library( - ActsExamplesIoEDM4hep SHARED - src/EDM4hepMeasurementReader.cpp - src/EDM4hepMeasurementWriter.cpp - src/EDM4hepMultiTrajectoryWriter.cpp - src/EDM4hepReader.cpp - src/EDM4hepTrackWriter.cpp - src/EDM4hepTrackReader.cpp - src/EDM4hepParticleWriter.cpp - src/EDM4hepSimHitWriter.cpp - src/EDM4hepUtil.cpp) + ActsExamplesIoEDM4hep + SHARED + src/EDM4hepMeasurementReader.cpp + src/EDM4hepMeasurementWriter.cpp + src/EDM4hepMultiTrajectoryWriter.cpp + src/EDM4hepReader.cpp + src/EDM4hepTrackWriter.cpp + src/EDM4hepTrackReader.cpp + src/EDM4hepParticleWriter.cpp + src/EDM4hepSimHitWriter.cpp + src/EDM4hepUtil.cpp +) target_include_directories( - ActsExamplesIoEDM4hep - PUBLIC $) + ActsExamplesIoEDM4hep + PUBLIC $ +) target_link_libraries( - ActsExamplesIoEDM4hep - PUBLIC - EDM4HEP::edm4hep - ActsPluginEDM4hep - podio::podioRootIO - ActsCore - ActsFatras - ActsExamplesFramework - ActsExamplesDigitization - ActsExamplesDetectorDD4hep) + ActsExamplesIoEDM4hep + PUBLIC + EDM4HEP::edm4hep + ActsPluginEDM4hep + podio::podioRootIO + ActsCore + ActsFatras + ActsExamplesFramework + ActsExamplesDigitization + ActsExamplesDetectorDD4hep +) install( - TARGETS ActsExamplesIoEDM4hep - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesIoEDM4hep + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Io/HepMC3/CMakeLists.txt b/Examples/Io/HepMC3/CMakeLists.txt index 4eb850a326b..44d0f9d96ae 100644 --- a/Examples/Io/HepMC3/CMakeLists.txt +++ b/Examples/Io/HepMC3/CMakeLists.txt @@ -1,21 +1,28 @@ add_library( - ActsExamplesIoHepMC3 SHARED - src/HepMC3Event.cpp - src/HepMC3Particle.cpp - src/HepMC3Reader.cpp - src/HepMC3Vertex.cpp - src/HepMC3Writer.cpp) + ActsExamplesIoHepMC3 + SHARED + src/HepMC3Event.cpp + src/HepMC3Particle.cpp + src/HepMC3Reader.cpp + src/HepMC3Vertex.cpp + src/HepMC3Writer.cpp +) target_include_directories( - ActsExamplesIoHepMC3 - SYSTEM PUBLIC ${HEPMC3_INCLUDE_DIR}) + ActsExamplesIoHepMC3 + SYSTEM + PUBLIC ${HEPMC3_INCLUDE_DIR} +) target_include_directories( - ActsExamplesIoHepMC3 - PUBLIC $) + ActsExamplesIoHepMC3 + PUBLIC $ +) target_link_libraries( - ActsExamplesIoHepMC3 - PUBLIC ActsCore ActsExamplesFramework ${HEPMC3_LIBRARIES} - PRIVATE ActsFatras) + ActsExamplesIoHepMC3 + PUBLIC ActsCore ActsExamplesFramework ${HEPMC3_LIBRARIES} + PRIVATE ActsFatras +) install( - TARGETS ActsExamplesIoHepMC3 - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesIoHepMC3 + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Io/Json/CMakeLists.txt b/Examples/Io/Json/CMakeLists.txt index aaedc77ce54..255d862881f 100644 --- a/Examples/Io/Json/CMakeLists.txt +++ b/Examples/Io/Json/CMakeLists.txt @@ -1,17 +1,24 @@ add_library( - ActsExamplesIoJson SHARED - src/JsonGeometryList.cpp - src/JsonMaterialWriter.cpp - src/JsonSurfacesWriter.cpp - src/JsonSurfacesReader.cpp - src/JsonDigitizationConfig.cpp) + ActsExamplesIoJson + SHARED + src/JsonGeometryList.cpp + src/JsonMaterialWriter.cpp + src/JsonSurfacesWriter.cpp + src/JsonSurfacesReader.cpp + src/JsonDigitizationConfig.cpp +) target_include_directories( - ActsExamplesIoJson - PUBLIC $) + ActsExamplesIoJson + PUBLIC $ +) target_link_libraries( - ActsExamplesIoJson - PUBLIC ActsCore ActsPluginJson ActsExamplesDigitization ActsExamplesFramework ActsExamplesMaterialMapping) + ActsExamplesIoJson + PUBLIC + ActsCore + ActsPluginJson + ActsExamplesDigitization + ActsExamplesFramework + ActsExamplesMaterialMapping +) -install( - TARGETS ActsExamplesIoJson - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS ActsExamplesIoJson LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/Examples/Io/NuclearInteractions/CMakeLists.txt b/Examples/Io/NuclearInteractions/CMakeLists.txt index 8de6d3ff77c..3f7ad2b9b9b 100644 --- a/Examples/Io/NuclearInteractions/CMakeLists.txt +++ b/Examples/Io/NuclearInteractions/CMakeLists.txt @@ -1,18 +1,20 @@ add_library( - ActsExamplesIoNuclearInteractions SHARED - src/RootNuclearInteractionParametersWriter.cpp - src/detail/NuclearInteractionParametrisation.cpp + ActsExamplesIoNuclearInteractions + SHARED + src/RootNuclearInteractionParametersWriter.cpp + src/detail/NuclearInteractionParametrisation.cpp ) target_include_directories( - ActsExamplesIoNuclearInteractions - PUBLIC $) + ActsExamplesIoNuclearInteractions + PUBLIC $ +) target_link_libraries( - ActsExamplesIoNuclearInteractions - PUBLIC - ActsCore ActsExamplesFramework - Threads::Threads - PRIVATE ROOT::Core ROOT::Hist ROOT::Tree) + ActsExamplesIoNuclearInteractions + PUBLIC ActsCore ActsExamplesFramework Threads::Threads + PRIVATE ROOT::Core ROOT::Hist ROOT::Tree +) install( - TARGETS ActsExamplesIoNuclearInteractions - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesIoNuclearInteractions + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Io/Obj/CMakeLists.txt b/Examples/Io/Obj/CMakeLists.txt index e8fc75a6d80..a332b22cb4a 100644 --- a/Examples/Io/Obj/CMakeLists.txt +++ b/Examples/Io/Obj/CMakeLists.txt @@ -1,13 +1,11 @@ -add_library( - ActsExamplesIoObj SHARED - src/ObjTrackingGeometryWriter.cpp) +add_library(ActsExamplesIoObj SHARED src/ObjTrackingGeometryWriter.cpp) target_include_directories( - ActsExamplesIoObj - PUBLIC $) + ActsExamplesIoObj + PUBLIC $ +) target_link_libraries( - ActsExamplesIoObj - PUBLIC ActsCore ActsExamplesFramework Threads::Threads) + ActsExamplesIoObj + PUBLIC ActsCore ActsExamplesFramework Threads::Threads +) -install( - TARGETS ActsExamplesIoObj - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS ActsExamplesIoObj LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/Examples/Io/Performance/CMakeLists.txt b/Examples/Io/Performance/CMakeLists.txt index 7f9f6d130b7..b41bf76ea07 100644 --- a/Examples/Io/Performance/CMakeLists.txt +++ b/Examples/Io/Performance/CMakeLists.txt @@ -1,19 +1,23 @@ add_library( - ActsExamplesIoPerformance SHARED - ActsExamples/Io/Performance/CKFPerformanceWriter.cpp - ActsExamples/Io/Performance/SeedingPerformanceWriter.cpp - ActsExamples/Io/Performance/TrackFinderPerformanceWriter.cpp - ActsExamples/Io/Performance/TrackFitterPerformanceWriter.cpp - ActsExamples/Io/Performance/VertexPerformanceWriter.cpp + ActsExamplesIoPerformance + SHARED + ActsExamples/Io/Performance/CKFPerformanceWriter.cpp + ActsExamples/Io/Performance/SeedingPerformanceWriter.cpp + ActsExamples/Io/Performance/TrackFinderPerformanceWriter.cpp + ActsExamples/Io/Performance/TrackFitterPerformanceWriter.cpp + ActsExamples/Io/Performance/VertexPerformanceWriter.cpp ) target_include_directories( - ActsExamplesIoPerformance - PUBLIC $) + ActsExamplesIoPerformance + PUBLIC $ +) target_link_libraries( - ActsExamplesIoPerformance - PUBLIC ActsExamplesFramework - PRIVATE ActsCore ROOT::Core ROOT::Tree) + ActsExamplesIoPerformance + PUBLIC ActsExamplesFramework + PRIVATE ActsCore ROOT::Core ROOT::Tree +) install( - TARGETS ActsExamplesIoPerformance - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsExamplesIoPerformance + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/Examples/Io/Root/CMakeLists.txt b/Examples/Io/Root/CMakeLists.txt index f43087361fd..3823be24194 100644 --- a/Examples/Io/Root/CMakeLists.txt +++ b/Examples/Io/Root/CMakeLists.txt @@ -1,45 +1,48 @@ add_library( - ActsExamplesIoRoot SHARED - src/RootMeasurementWriter.cpp - src/RootMaterialDecorator.cpp - src/RootMaterialWriter.cpp - src/RootMaterialTrackReader.cpp - src/RootMaterialTrackWriter.cpp - src/RootParticleWriter.cpp - src/RootParticleReader.cpp - src/RootPropagationStepsWriter.cpp - src/RootSeedWriter.cpp - src/RootSimHitWriter.cpp - src/RootSimHitReader.cpp - src/RootSpacepointWriter.cpp - src/RootTrackParameterWriter.cpp - src/RootTrackStatesWriter.cpp - src/RootTrackSummaryReader.cpp - src/RootTrackSummaryWriter.cpp - src/RootBFieldWriter.cpp - src/RootAthenaNTupleReader.cpp - src/RootVertexReader.cpp - src/RootVertexWriter.cpp - src/RootAthenaDumpReader.cpp + ActsExamplesIoRoot + SHARED + src/RootMeasurementWriter.cpp + src/RootMaterialDecorator.cpp + src/RootMaterialWriter.cpp + src/RootMaterialTrackReader.cpp + src/RootMaterialTrackWriter.cpp + src/RootParticleWriter.cpp + src/RootParticleReader.cpp + src/RootPropagationStepsWriter.cpp + src/RootSeedWriter.cpp + src/RootSimHitWriter.cpp + src/RootSimHitReader.cpp + src/RootSpacepointWriter.cpp + src/RootTrackParameterWriter.cpp + src/RootTrackStatesWriter.cpp + src/RootTrackSummaryReader.cpp + src/RootTrackSummaryWriter.cpp + src/RootBFieldWriter.cpp + src/RootAthenaNTupleReader.cpp + src/RootVertexReader.cpp + src/RootVertexWriter.cpp + src/RootAthenaDumpReader.cpp ) target_include_directories( - ActsExamplesIoRoot - PUBLIC $) + ActsExamplesIoRoot + PUBLIC $ +) target_link_libraries( - ActsExamplesIoRoot - PUBLIC - ActsCore ActsExamplesDigitization - ActsExamplesFramework ActsExamplesPropagation - ActsExamplesTruthTracking ActsExamplesMaterialMapping - Threads::Threads - PRIVATE - ROOT::Core ROOT::Hist ROOT::Tree) + ActsExamplesIoRoot + PUBLIC + ActsCore + ActsExamplesDigitization + ActsExamplesFramework + ActsExamplesPropagation + ActsExamplesTruthTracking + ActsExamplesMaterialMapping + Threads::Threads + PRIVATE ROOT::Core ROOT::Hist ROOT::Tree +) -ROOT_GENERATE_DICTIONARY( - ActsExamplesIoRootDict MODULE ActsExamplesIoRoot LINKDEF LinkDef.hpp) -set_target_properties( - ActsExamplesIoRootDict PROPERTIES CXX_CLANG_TIDY "") +root_generate_dictionary( + ActsExamplesIoRootDict MODULE ActsExamplesIoRoot LINKDEF LinkDef.hpp +) +set_target_properties(ActsExamplesIoRootDict PROPERTIES CXX_CLANG_TIDY "") -install( - TARGETS ActsExamplesIoRoot - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS ActsExamplesIoRoot LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/Examples/Io/Svg/CMakeLists.txt b/Examples/Io/Svg/CMakeLists.txt index 1eb1a321111..7614ed97442 100644 --- a/Examples/Io/Svg/CMakeLists.txt +++ b/Examples/Io/Svg/CMakeLists.txt @@ -1,13 +1,11 @@ -add_library( - ActsExamplesIoSvg SHARED - src/SvgTrackingGeometryWriter.cpp) +add_library(ActsExamplesIoSvg SHARED src/SvgTrackingGeometryWriter.cpp) target_include_directories( ActsExamplesIoSvg - PUBLIC $) + PUBLIC $ +) target_link_libraries( - ActsExamplesIoSvg - PUBLIC ActsCore ActsExamplesFramework ActsPluginActSVG Threads::Threads) + ActsExamplesIoSvg + PUBLIC ActsCore ActsExamplesFramework ActsPluginActSVG Threads::Threads +) -install( - TARGETS ActsExamplesIoSvg - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS ActsExamplesIoSvg LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/Examples/Python/CMakeLists.txt b/Examples/Python/CMakeLists.txt index f991ea59dcc..56721a3eb7c 100644 --- a/Examples/Python/CMakeLists.txt +++ b/Examples/Python/CMakeLists.txt @@ -32,188 +32,266 @@ pybind11_add_module(ActsPythonBindings ) install(TARGETS ActsPythonBindings DESTINATION ${_python_install_dir}) -set_target_properties(ActsPythonBindings PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}") -set_target_properties(ActsPythonBindings PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts) - -target_link_libraries(ActsPythonBindings PUBLIC - ActsCore - ActsPythonUtilities - ActsExamplesFramework - ActsExamplesGeometry - ActsExamplesDetectorGeneric - ActsExamplesDetectorContextual - ActsExamplesDetectorTGeo - ActsExamplesMagneticField - ActsExamplesIoRoot - ActsExamplesIoNuclearInteractions - ActsExamplesIoCsv - ActsExamplesIoObj - ActsExamplesIoJson - ActsExamplesIoPerformance - ActsExamplesGenerators - ActsExamplesPrinters - ActsExamplesTrackFinding - ActsExamplesTrackFitting - ActsExamplesVertexing - ActsExamplesFatras - ActsExamplesDetectorTelescope - ActsExamplesUtilities - ActsExamplesAmbiguityResolution +set_target_properties( + ActsPythonBindings + PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}" +) +set_target_properties( + ActsPythonBindings + PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts +) + +target_link_libraries( + ActsPythonBindings + PUBLIC + ActsCore + ActsPythonUtilities + ActsExamplesFramework + ActsExamplesGeometry + ActsExamplesDetectorGeneric + ActsExamplesDetectorContextual + ActsExamplesDetectorTGeo + ActsExamplesMagneticField + ActsExamplesIoRoot + ActsExamplesIoNuclearInteractions + ActsExamplesIoCsv + ActsExamplesIoObj + ActsExamplesIoJson + ActsExamplesIoPerformance + ActsExamplesGenerators + ActsExamplesPrinters + ActsExamplesTrackFinding + ActsExamplesTrackFitting + ActsExamplesVertexing + ActsExamplesFatras + ActsExamplesDetectorTelescope + ActsExamplesUtilities + ActsExamplesAmbiguityResolution ) set(py_files - __init__.py - examples/__init__.py - examples/simulation.py - examples/reconstruction.py - examples/itk.py - examples/odd.py - _adapter.py + __init__.py + examples/__init__.py + examples/simulation.py + examples/reconstruction.py + examples/itk.py + examples/odd.py + _adapter.py ) if(ACTS_BUILD_PLUGIN_JSON) - target_link_libraries(ActsPythonBindings PUBLIC ActsPluginJson) - target_sources(ActsPythonBindings PRIVATE src/Json.cpp) + target_link_libraries(ActsPythonBindings PUBLIC ActsPluginJson) + target_sources(ActsPythonBindings PRIVATE src/Json.cpp) else() - target_sources(ActsPythonBindings PRIVATE src/JsonStub.cpp) + target_sources(ActsPythonBindings PRIVATE src/JsonStub.cpp) endif() if(ACTS_BUILD_PLUGIN_GEOMODEL) - target_link_libraries(ActsPythonBindings PUBLIC ActsPluginGeoModel) - target_sources(ActsPythonBindings PRIVATE src/GeoModel.cpp) + target_link_libraries(ActsPythonBindings PUBLIC ActsPluginGeoModel) + target_sources(ActsPythonBindings PRIVATE src/GeoModel.cpp) else() - target_sources(ActsPythonBindings PRIVATE src/GeoModelStub.cpp) + target_sources(ActsPythonBindings PRIVATE src/GeoModelStub.cpp) endif() if(ACTS_BUILD_PLUGIN_TRACCC) - target_link_libraries(ActsPythonBindings PUBLIC ActsPluginDetray) - target_sources(ActsPythonBindings PRIVATE src/Detray.cpp) + target_link_libraries(ActsPythonBindings PUBLIC ActsPluginDetray) + target_sources(ActsPythonBindings PRIVATE src/Detray.cpp) else() - target_sources(ActsPythonBindings PRIVATE src/DetrayStub.cpp) + target_sources(ActsPythonBindings PRIVATE src/DetrayStub.cpp) endif() if(ACTS_BUILD_PLUGIN_ACTSVG) - target_link_libraries(ActsPythonBindings PUBLIC ActsExamplesIoSvg) - target_sources(ActsPythonBindings PRIVATE src/Svg.cpp) + target_link_libraries(ActsPythonBindings PUBLIC ActsExamplesIoSvg) + target_sources(ActsPythonBindings PRIVATE src/Svg.cpp) else() - target_sources(ActsPythonBindings PRIVATE src/SvgStub.cpp) + target_sources(ActsPythonBindings PRIVATE src/SvgStub.cpp) endif() if(ACTS_BUILD_PLUGIN_DD4HEP AND ACTS_BUILD_EXAMPLES_DD4HEP) - pybind11_add_module(ActsPythonBindingsDD4hep src/DD4hepComponent.cpp) - target_link_libraries(ActsPythonBindingsDD4hep PUBLIC - ActsPythonUtilities - ActsExamplesDetectorDD4hep) - add_dependencies(ActsPythonBindings ActsPythonBindingsDD4hep) - - install(TARGETS ActsPythonBindingsDD4hep DESTINATION ${_python_install_dir}) - set_target_properties(ActsPythonBindingsDD4hep PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}") - set_target_properties(ActsPythonBindingsDD4hep PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts) - list(APPEND py_files examples/dd4hep.py) + pybind11_add_module(ActsPythonBindingsDD4hep src/DD4hepComponent.cpp) + target_link_libraries( + ActsPythonBindingsDD4hep + PUBLIC ActsPythonUtilities ActsExamplesDetectorDD4hep + ) + add_dependencies(ActsPythonBindings ActsPythonBindingsDD4hep) + + install(TARGETS ActsPythonBindingsDD4hep DESTINATION ${_python_install_dir}) + set_target_properties( + ActsPythonBindingsDD4hep + PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}" + ) + set_target_properties( + ActsPythonBindingsDD4hep + PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts + ) + list(APPEND py_files examples/dd4hep.py) endif() if(ACTS_BUILD_EXAMPLES_PYTHIA8) - target_link_libraries(ActsPythonBindings PUBLIC ActsExamplesGeneratorsPythia8) - target_sources(ActsPythonBindings PRIVATE src/Pythia8.cpp) + target_link_libraries( + ActsPythonBindings + PUBLIC ActsExamplesGeneratorsPythia8 + ) + target_sources(ActsPythonBindings PRIVATE src/Pythia8.cpp) else() - target_sources(ActsPythonBindings PRIVATE src/Pythia8Stub.cpp) + target_sources(ActsPythonBindings PRIVATE src/Pythia8Stub.cpp) endif() if(ACTS_BUILD_EXAMPLES_GEANT4) - pybind11_add_module(ActsPythonBindingsGeant4 src/Geant4Component.cpp) - target_link_libraries(ActsPythonBindingsGeant4 PUBLIC - ActsExamplesGeant4 ActsExamplesDetectorGeant4 - ActsPythonUtilities ActsExamplesMuonSpectrometerMockupDetector) - add_dependencies(ActsPythonBindings ActsPythonBindingsGeant4) - - install(TARGETS ActsPythonBindingsGeant4 DESTINATION ${_python_install_dir}) - set_target_properties(ActsPythonBindingsGeant4 PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}") - set_target_properties(ActsPythonBindingsGeant4 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts) - list(APPEND py_files examples/geant4/__init__.py) - - if(ACTS_BUILD_PLUGIN_DD4HEP AND ACTS_BUILD_EXAMPLES_DD4HEP) - pybind11_add_module(ActsPythonBindingsDDG4 src/Geant4DD4hepComponent.cpp) - target_link_libraries(ActsPythonBindingsDDG4 PUBLIC - ActsPythonUtilities - ActsExamplesGeant4 - ActsExamplesDetectorDD4hep) - add_dependencies(ActsPythonBindings ActsPythonBindingsDDG4) - - install(TARGETS ActsPythonBindingsDDG4 DESTINATION ${_python_install_dir}) - set_target_properties(ActsPythonBindingsDDG4 PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}") - set_target_properties(ActsPythonBindingsDDG4 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts) - list(APPEND py_files examples/geant4/dd4hep.py) - endif() - - if(ACTS_BUILD_PLUGIN_GEOMODEL) - pybind11_add_module(ActsPythonBindingsGeoModelG4 src/Geant4GeoModelComponent.cpp) - target_link_libraries(ActsPythonBindingsGeoModelG4 PUBLIC - ActsPythonUtilities - ActsExamplesGeant4) - add_dependencies(ActsPythonBindings ActsPythonBindingsGeoModelG4) - install(TARGETS ActsPythonBindingsGeoModelG4 DESTINATION ${_python_install_dir}) - set_target_properties(ActsPythonBindingsGeoModelG4 PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}") - set_target_properties(ActsPythonBindingsGeoModelG4 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts) - - list(APPEND py_files examples/geant4/geomodel.py) - endif() - - if(ACTS_BUILD_EXAMPLES_HEPMC3) - target_link_libraries(ActsPythonBindingsGeant4 PUBLIC ActsExamplesEventRecording) - target_sources(ActsPythonBindingsGeant4 PRIVATE src/Geant4HepMC3.cpp) - list(APPEND py_files examples/geant4/hepmc3.py) - else() - target_sources(ActsPythonBindingsGeant4 PRIVATE src/Geant4HepMC3Stub.cpp) - endif() + pybind11_add_module(ActsPythonBindingsGeant4 src/Geant4Component.cpp) + target_link_libraries( + ActsPythonBindingsGeant4 + PUBLIC + ActsExamplesGeant4 + ActsExamplesDetectorGeant4 + ActsPythonUtilities + ActsExamplesMuonSpectrometerMockupDetector + ) + add_dependencies(ActsPythonBindings ActsPythonBindingsGeant4) + + install(TARGETS ActsPythonBindingsGeant4 DESTINATION ${_python_install_dir}) + set_target_properties( + ActsPythonBindingsGeant4 + PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}" + ) + set_target_properties( + ActsPythonBindingsGeant4 + PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts + ) + list(APPEND py_files examples/geant4/__init__.py) + + if(ACTS_BUILD_PLUGIN_DD4HEP AND ACTS_BUILD_EXAMPLES_DD4HEP) + pybind11_add_module(ActsPythonBindingsDDG4 src/Geant4DD4hepComponent.cpp) + target_link_libraries( + ActsPythonBindingsDDG4 + PUBLIC + ActsPythonUtilities + ActsExamplesGeant4 + ActsExamplesDetectorDD4hep + ) + add_dependencies(ActsPythonBindings ActsPythonBindingsDDG4) + install( + TARGETS ActsPythonBindingsDDG4 DESTINATION ${_python_install_dir} + ) + set_target_properties( + ActsPythonBindingsDDG4 + PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}" + ) + set_target_properties( + ActsPythonBindingsDDG4 + PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts + ) + list(APPEND py_files examples/geant4/dd4hep.py) + endif() + + if(ACTS_BUILD_PLUGIN_GEOMODEL) + pybind11_add_module(ActsPythonBindingsGeoModelG4 src/Geant4GeoModelComponent.cpp) + target_link_libraries( + ActsPythonBindingsGeoModelG4 + PUBLIC ActsPythonUtilities ActsExamplesGeant4 + ) + add_dependencies(ActsPythonBindings ActsPythonBindingsGeoModelG4) + install( + TARGETS + ActsPythonBindingsGeoModelG4 + DESTINATION + ${_python_install_dir} + ) + set_target_properties( + ActsPythonBindingsGeoModelG4 + PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}" + ) + set_target_properties( + ActsPythonBindingsGeoModelG4 + PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts + ) + + list(APPEND py_files examples/geant4/geomodel.py) + endif() + + if(ACTS_BUILD_EXAMPLES_HEPMC3) + target_link_libraries( + ActsPythonBindingsGeant4 + PUBLIC ActsExamplesEventRecording + ) + target_sources(ActsPythonBindingsGeant4 PRIVATE src/Geant4HepMC3.cpp) + list(APPEND py_files examples/geant4/hepmc3.py) + else() + target_sources( + ActsPythonBindingsGeant4 + PRIVATE src/Geant4HepMC3Stub.cpp + ) + endif() endif() if(ACTS_BUILD_EXAMPLES_HEPMC3) - target_link_libraries(ActsPythonBindings PUBLIC ActsExamplesHepMC3) - target_sources(ActsPythonBindings PRIVATE src/HepMC3.cpp) - list(APPEND py_files examples/hepmc3.py) + target_link_libraries(ActsPythonBindings PUBLIC ActsExamplesHepMC3) + target_sources(ActsPythonBindings PRIVATE src/HepMC3.cpp) + list(APPEND py_files examples/hepmc3.py) else() - target_sources(ActsPythonBindings PRIVATE src/HepMC3Stub.cpp) + target_sources(ActsPythonBindings PRIVATE src/HepMC3Stub.cpp) endif() if(ACTS_BUILD_EXAMPLES_EXATRKX) - target_link_libraries(ActsPythonBindings PUBLIC ActsExamplesTrackFindingExaTrkX) - target_sources(ActsPythonBindings PRIVATE src/ExaTrkXTrackFinding.cpp) + target_link_libraries( + ActsPythonBindings + PUBLIC ActsExamplesTrackFindingExaTrkX + ) + target_sources(ActsPythonBindings PRIVATE src/ExaTrkXTrackFinding.cpp) else() - target_sources(ActsPythonBindings PRIVATE src/ExaTrkXTrackFindingStub.cpp) + target_sources(ActsPythonBindings PRIVATE src/ExaTrkXTrackFindingStub.cpp) endif() if(ACTS_BUILD_EXAMPLES_EDM4HEP) - pybind11_add_module(ActsPythonBindingsEDM4hep src/EDM4hepComponent.cpp) - target_link_libraries(ActsPythonBindingsEDM4hep PUBLIC - ActsPythonUtilities ActsExamplesIoEDM4hep) - add_dependencies(ActsPythonBindings ActsPythonBindingsEDM4hep) - install(TARGETS ActsPythonBindingsEDM4hep DESTINATION ${_python_install_dir}) - set_target_properties(ActsPythonBindingsEDM4hep PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}") - set_target_properties(ActsPythonBindingsEDM4hep PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts) - list(APPEND py_files examples/edm4hep.py) + pybind11_add_module(ActsPythonBindingsEDM4hep src/EDM4hepComponent.cpp) + target_link_libraries( + ActsPythonBindingsEDM4hep + PUBLIC ActsPythonUtilities ActsExamplesIoEDM4hep + ) + add_dependencies(ActsPythonBindings ActsPythonBindingsEDM4hep) + install( + TARGETS ActsPythonBindingsEDM4hep DESTINATION ${_python_install_dir} + ) + set_target_properties( + ActsPythonBindingsEDM4hep + PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}" + ) + set_target_properties( + ActsPythonBindingsEDM4hep + PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts + ) + list(APPEND py_files examples/edm4hep.py) endif() if(ACTS_BUILD_PLUGIN_ONNX) - target_link_libraries(ActsPythonBindings PUBLIC ActsExamplesFrameworkML ActsExamplesTrackFindingML) - target_sources(ActsPythonBindings PRIVATE src/Onnx.cpp) - target_sources(ActsPythonBindings PRIVATE src/OnnxNeuralCalibrator.cpp) - list(APPEND py_files examples/onnx/__init__.py) - + target_link_libraries( + ActsPythonBindings + PUBLIC ActsExamplesFrameworkML ActsExamplesTrackFindingML + ) + target_sources(ActsPythonBindings PRIVATE src/Onnx.cpp) + target_sources(ActsPythonBindings PRIVATE src/OnnxNeuralCalibrator.cpp) + list(APPEND py_files examples/onnx/__init__.py) else() - target_sources(ActsPythonBindings PRIVATE src/OnnxStub.cpp) - target_sources(ActsPythonBindings PRIVATE src/OnnxNeuralCalibratorStub.cpp) + target_sources(ActsPythonBindings PRIVATE src/OnnxStub.cpp) + target_sources(ActsPythonBindings PRIVATE src/OnnxNeuralCalibratorStub.cpp) endif() configure_file(setup.sh.in ${_python_dir}/setup.sh @ONLY) install(FILES ${_python_dir}/setup.sh DESTINATION "python") foreach(f ${py_files}) -set(_target ${_python_dir}/acts/${f}) -get_filename_component(_dir ${_target} DIRECTORY) -file(MAKE_DIRECTORY ${_dir}) + set(_target ${_python_dir}/acts/${f}) + get_filename_component(_dir ${_target} DIRECTORY) + file(MAKE_DIRECTORY ${_dir}) -file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/python/acts/${f} ${_target} SYMBOLIC) + file( + CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/python/acts/${f} ${_target} + SYMBOLIC + ) endforeach() -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/python/acts/ DESTINATION ${_python_install_dir}) +install( + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/python/acts/ + DESTINATION ${_python_install_dir} +) diff --git a/Examples/Scripts/MaterialMapping/CMakeLists.txt b/Examples/Scripts/MaterialMapping/CMakeLists.txt index f1a5dae6d1d..ee1d03873b0 100644 --- a/Examples/Scripts/MaterialMapping/CMakeLists.txt +++ b/Examples/Scripts/MaterialMapping/CMakeLists.txt @@ -1,7 +1,16 @@ add_executable(ActsAnalysisMaterialComposition MaterialComposition.cpp) -target_link_libraries(ActsAnalysisMaterialComposition ActsExamplesFramework ROOT::Core ROOT::Hist ROOT::Tree ROOT::TreePlayer Boost::program_options nlohmann_json::nlohmann_json) +target_link_libraries( + ActsAnalysisMaterialComposition + ActsExamplesFramework + ROOT::Core + ROOT::Hist + ROOT::Tree + ROOT::TreePlayer + Boost::program_options + nlohmann_json::nlohmann_json +) install( - TARGETS - ActsAnalysisMaterialComposition - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + TARGETS ActsAnalysisMaterialComposition + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/Examples/Scripts/TrackingPerformance/CMakeLists.txt b/Examples/Scripts/TrackingPerformance/CMakeLists.txt index 31492084b0c..7e6fb6df7b6 100644 --- a/Examples/Scripts/TrackingPerformance/CMakeLists.txt +++ b/Examples/Scripts/TrackingPerformance/CMakeLists.txt @@ -1,23 +1,26 @@ add_executable(ActsAnalysisResidualsAndPulls ResidualsAndPulls.cpp) -target_link_libraries(ActsAnalysisResidualsAndPulls - ROOT::Core - ROOT::Hist - ROOT::Tree - ROOT::TreePlayer - Boost::program_options) +target_link_libraries( + ActsAnalysisResidualsAndPulls + ROOT::Core + ROOT::Hist + ROOT::Tree + ROOT::TreePlayer + Boost::program_options +) add_executable(ActsAnalysisTrackSummary TrackSummary.cpp) -target_link_libraries(ActsAnalysisTrackSummary - ActsExamplesFramework - ROOT::Core - ROOT::Hist - ROOT::Tree - ROOT::TreePlayer - Boost::program_options - nlohmann_json::nlohmann_json) +target_link_libraries( + ActsAnalysisTrackSummary + ActsExamplesFramework + ROOT::Core + ROOT::Hist + ROOT::Tree + ROOT::TreePlayer + Boost::program_options + nlohmann_json::nlohmann_json +) install( - TARGETS - ActsAnalysisResidualsAndPulls - ActsAnalysisTrackSummary - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + TARGETS ActsAnalysisResidualsAndPulls ActsAnalysisTrackSummary + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/Fatras/CMakeLists.txt b/Fatras/CMakeLists.txt index 1fdfe72e961..4e998b1ea17 100644 --- a/Fatras/CMakeLists.txt +++ b/Fatras/CMakeLists.txt @@ -1,34 +1,34 @@ add_library( - ActsFatras SHARED - src/Digitization/Segmentizer.cpp - src/Digitization/DigitizationError.cpp - src/Digitization/PlanarSurfaceMask.cpp - src/Digitization/PlanarSurfaceDrift.cpp - src/EventData/Particle.cpp - src/EventData/ParticleOutcome.cpp - src/EventData/ProcessType.cpp - src/Kernel/SimulationError.cpp - src/Physics/BetheHeitler.cpp - src/Physics/NuclearInteraction/NuclearInteraction.cpp - src/Physics/PhotonConversion.cpp - src/Physics/StandardInteractions.cpp - src/Utilities/LandauDistribution.cpp) + ActsFatras + SHARED + src/Digitization/Segmentizer.cpp + src/Digitization/DigitizationError.cpp + src/Digitization/PlanarSurfaceMask.cpp + src/Digitization/PlanarSurfaceDrift.cpp + src/EventData/Particle.cpp + src/EventData/ParticleOutcome.cpp + src/EventData/ProcessType.cpp + src/Kernel/SimulationError.cpp + src/Physics/BetheHeitler.cpp + src/Physics/NuclearInteraction/NuclearInteraction.cpp + src/Physics/PhotonConversion.cpp + src/Physics/StandardInteractions.cpp + src/Utilities/LandauDistribution.cpp +) target_include_directories( - ActsFatras - PUBLIC - $ - $) -target_link_libraries( - ActsFatras - PUBLIC ActsCore) + ActsFatras + PUBLIC + $ + $ +) +target_link_libraries(ActsFatras PUBLIC ActsCore) install( - TARGETS ActsFatras - EXPORT ActsFatrasTargets + TARGETS ActsFatras + EXPORT ActsFatrasTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -install( - DIRECTORY include/ActsFatras - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) +install(DIRECTORY include/ActsFatras DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) add_component_if(Geant4 FatrasGeant4 ACTS_BUILD_FATRAS_GEANT4) diff --git a/Fatras/Geant4/CMakeLists.txt b/Fatras/Geant4/CMakeLists.txt index 074f558b78f..a0645174913 100644 --- a/Fatras/Geant4/CMakeLists.txt +++ b/Fatras/Geant4/CMakeLists.txt @@ -1,28 +1,31 @@ add_library( - ActsFatrasGeant4 SHARED - src/Geant4Decay.cpp - src/PDGtoG4Converter.cpp - src/DummyDetectorConstruction.cpp) -target_compile_definitions( - ActsFatrasGeant4 - PUBLIC ${Geant4_DEFINITIONS}) + ActsFatrasGeant4 + SHARED + src/Geant4Decay.cpp + src/PDGtoG4Converter.cpp + src/DummyDetectorConstruction.cpp +) +target_compile_definitions(ActsFatrasGeant4 PUBLIC ${Geant4_DEFINITIONS}) target_include_directories( - ActsFatrasGeant4 - SYSTEM PUBLIC ${Geant4_INCLUDE_DIRS}) + ActsFatrasGeant4 + SYSTEM + PUBLIC ${Geant4_INCLUDE_DIRS} +) target_include_directories( - ActsFatrasGeant4 - PUBLIC - $ - $) + ActsFatrasGeant4 + PUBLIC + $ + $ +) target_link_libraries( - ActsFatrasGeant4 - PUBLIC ActsCore ActsFatras ${Geant4_LIBRARIES}) + ActsFatrasGeant4 + PUBLIC ActsCore ActsFatras ${Geant4_LIBRARIES} +) install( - TARGETS ActsFatrasGeant4 - EXPORT ActsFatrasGeant4Targets + TARGETS ActsFatrasGeant4 + EXPORT ActsFatrasGeant4Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -install( - DIRECTORY include/ActsFatras - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) +install(DIRECTORY include/ActsFatras DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Plugins/ActSVG/CMakeLists.txt b/Plugins/ActSVG/CMakeLists.txt index b156e5a5edd..917d56062e4 100644 --- a/Plugins/ActSVG/CMakeLists.txt +++ b/Plugins/ActSVG/CMakeLists.txt @@ -1,30 +1,30 @@ add_library( - ActsPluginActSVG SHARED - src/DetectorVolumeSvgConverter.cpp - src/DetectorSvgConverter.cpp - src/EventDataSvgConverter.cpp - src/LayerSvgConverter.cpp - src/PortalSvgConverter.cpp - src/SurfaceArraySvgConverter.cpp - src/SurfaceSvgConverter.cpp - src/TrackingGeometrySvgConverter.cpp) + ActsPluginActSVG + SHARED + src/DetectorVolumeSvgConverter.cpp + src/DetectorSvgConverter.cpp + src/EventDataSvgConverter.cpp + src/LayerSvgConverter.cpp + src/PortalSvgConverter.cpp + src/SurfaceArraySvgConverter.cpp + src/SurfaceSvgConverter.cpp + src/TrackingGeometrySvgConverter.cpp +) target_include_directories( - ActsPluginActSVG - PUBLIC - $ - $) + ActsPluginActSVG + PUBLIC + $ + $ +) target_link_libraries( - ActsPluginActSVG - PUBLIC - ActsCore - actsvg::core - actsvg::meta) + ActsPluginActSVG + PUBLIC ActsCore actsvg::core actsvg::meta +) install( - TARGETS ActsPluginActSVG - EXPORT ActsPluginActSVGTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install( - DIRECTORY include/Acts - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + TARGETS ActsPluginActSVG + EXPORT ActsPluginActSVGTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Plugins/Cuda/CMakeLists.txt b/Plugins/Cuda/CMakeLists.txt index bcbe9a808e1..21adefee36a 100644 --- a/Plugins/Cuda/CMakeLists.txt +++ b/Plugins/Cuda/CMakeLists.txt @@ -1,62 +1,59 @@ # Set up the "CUDA 1" plugin. find_library(CUDART_LIBRARY cudart ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}) -add_library( - ActsPluginCuda SHARED - src/Seeding/Kernels.cu -) +add_library(ActsPluginCuda SHARED src/Seeding/Kernels.cu) target_include_directories( - ActsPluginCuda - PUBLIC - $ - $ ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) -target_link_libraries( - ActsPluginCuda - PUBLIC ActsCore ${CUDART_LIBRARY}) + ActsPluginCuda + PUBLIC + $ + $ + ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES} +) +target_link_libraries(ActsPluginCuda PUBLIC ActsCore ${CUDART_LIBRARY}) # Set up the "CUDA 2" plugin. add_library( - ActsPluginCuda2 STATIC - include/Acts/Plugins/Cuda/Seeding2/Details/CountDublets.hpp - include/Acts/Plugins/Cuda/Seeding2/Details/FindDublets.hpp - include/Acts/Plugins/Cuda/Seeding2/Details/FindTriplets.hpp - include/Acts/Plugins/Cuda/Seeding2/Details/Types.hpp - include/Acts/Plugins/Cuda/Seeding2/SeedFinder.hpp - include/Acts/Plugins/Cuda/Seeding2/SeedFinder.ipp - include/Acts/Plugins/Cuda/Seeding2/TripletFilterConfig.hpp - include/Acts/Plugins/Cuda/Utilities/Arrays.hpp - include/Acts/Plugins/Cuda/Utilities/Info.hpp - include/Acts/Plugins/Cuda/Utilities/MemoryManager.hpp - include/Acts/Plugins/Cuda/Utilities/StreamWrapper.hpp - src/Seeding2/CountDublets.cu - src/Seeding2/FindDublets.cu - src/Seeding2/FindTriplets.cu - src/Utilities/Arrays.cu - src/Utilities/ErrorCheck.cuh - src/Utilities/ErrorCheck.cu - src/Utilities/Info.cu - src/Utilities/MatrixMacros.hpp - src/Utilities/MemoryManager.cu - src/Utilities/StreamHandlers.cuh - src/Utilities/StreamWrapper.cu + ActsPluginCuda2 + STATIC + include/Acts/Plugins/Cuda/Seeding2/Details/CountDublets.hpp + include/Acts/Plugins/Cuda/Seeding2/Details/FindDublets.hpp + include/Acts/Plugins/Cuda/Seeding2/Details/FindTriplets.hpp + include/Acts/Plugins/Cuda/Seeding2/Details/Types.hpp + include/Acts/Plugins/Cuda/Seeding2/SeedFinder.hpp + include/Acts/Plugins/Cuda/Seeding2/SeedFinder.ipp + include/Acts/Plugins/Cuda/Seeding2/TripletFilterConfig.hpp + include/Acts/Plugins/Cuda/Utilities/Arrays.hpp + include/Acts/Plugins/Cuda/Utilities/Info.hpp + include/Acts/Plugins/Cuda/Utilities/MemoryManager.hpp + include/Acts/Plugins/Cuda/Utilities/StreamWrapper.hpp + src/Seeding2/CountDublets.cu + src/Seeding2/FindDublets.cu + src/Seeding2/FindTriplets.cu + src/Utilities/Arrays.cu + src/Utilities/ErrorCheck.cuh + src/Utilities/ErrorCheck.cu + src/Utilities/Info.cu + src/Utilities/MatrixMacros.hpp + src/Utilities/MemoryManager.cu + src/Utilities/StreamHandlers.cuh + src/Utilities/StreamWrapper.cu ) target_include_directories( - ActsPluginCuda2 - PUBLIC - $ - $) -target_link_libraries( - ActsPluginCuda2 - PUBLIC ActsCore) -set_target_properties(ActsPluginCuda2 PROPERTIES - CUDA_SEPARABLE_COMPILATION ON - POSITION_INDEPENDENT_CODE ON) + ActsPluginCuda2 + PUBLIC + $ + $ +) +target_link_libraries(ActsPluginCuda2 PUBLIC ActsCore) +set_target_properties( + ActsPluginCuda2 + PROPERTIES CUDA_SEPARABLE_COMPILATION ON POSITION_INDEPENDENT_CODE ON +) # Install all CUDA plugins. install( - TARGETS ActsPluginCuda ActsPluginCuda2 - EXPORT ActsPluginCudaTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install( - DIRECTORY include/Acts - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + TARGETS ActsPluginCuda ActsPluginCuda2 + EXPORT ActsPluginCudaTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Plugins/Cuda/src/Seeding/CMakeLists.txt b/Plugins/Cuda/src/Seeding/CMakeLists.txt index b5e9bf68367..b8ef76f9a50 100644 --- a/Plugins/Cuda/src/Seeding/CMakeLists.txt +++ b/Plugins/Cuda/src/Seeding/CMakeLists.txt @@ -1,5 +1 @@ -target_sources( - ActsCore - PRIVATE - Kernels.cu -) +target_sources(ActsCore PRIVATE Kernels.cu) diff --git a/Plugins/DD4hep/CMakeLists.txt b/Plugins/DD4hep/CMakeLists.txt index 9af2f9fc7d1..bbaa90c77d0 100644 --- a/Plugins/DD4hep/CMakeLists.txt +++ b/Plugins/DD4hep/CMakeLists.txt @@ -1,39 +1,39 @@ include(FetchContent) add_library( - ActsPluginDD4hep SHARED - src/ConvertDD4hepDetector.cpp - src/DD4hepBlueprintFactory.cpp - src/DD4hepBinningHelpers.cpp - src/DD4hepDetectorStructure.cpp - src/DD4hepMaterialHelpers.cpp - src/DD4hepDetectorElement.cpp - src/DD4hepDetectorSurfaceFactory.cpp - src/DD4hepLayerBuilder.cpp - src/DD4hepLayerStructure.cpp - src/DD4hepVolumeBuilder.cpp - src/DD4hepFieldAdapter.cpp) + ActsPluginDD4hep + SHARED + src/ConvertDD4hepDetector.cpp + src/DD4hepBlueprintFactory.cpp + src/DD4hepBinningHelpers.cpp + src/DD4hepDetectorStructure.cpp + src/DD4hepMaterialHelpers.cpp + src/DD4hepDetectorElement.cpp + src/DD4hepDetectorSurfaceFactory.cpp + src/DD4hepLayerBuilder.cpp + src/DD4hepLayerStructure.cpp + src/DD4hepVolumeBuilder.cpp + src/DD4hepFieldAdapter.cpp +) target_include_directories( - ActsPluginDD4hep - PUBLIC - $ - $) -target_link_libraries( - ActsPluginDD4hep - PUBLIC ActsCore ActsPluginTGeo) + ActsPluginDD4hep + PUBLIC + $ + $ +) +target_link_libraries(ActsPluginDD4hep PUBLIC ActsCore ActsPluginTGeo) if(${DD4hep_VERSION} VERSION_LESS 1.11) - target_include_directories(ActsPluginDD4hep PUBLIC ${DD4hep_INCLUDE_DIRS}) - target_link_libraries(ActsPluginDD4hep PUBLIC ${DD4hep_DDCORE_LIBRARY}) + target_include_directories(ActsPluginDD4hep PUBLIC ${DD4hep_INCLUDE_DIRS}) + target_link_libraries(ActsPluginDD4hep PUBLIC ${DD4hep_DDCORE_LIBRARY}) else() - target_link_libraries(ActsPluginDD4hep PUBLIC DD4hep::DDCore DD4hep::DDRec) + target_link_libraries(ActsPluginDD4hep PUBLIC DD4hep::DDCore DD4hep::DDRec) endif() install( - TARGETS ActsPluginDD4hep - EXPORT ActsPluginDD4hepTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install( - DIRECTORY include/Acts - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + TARGETS ActsPluginDD4hep + EXPORT ActsPluginDD4hepTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Plugins/Detray/CMakeLists.txt b/Plugins/Detray/CMakeLists.txt index 3af182b7b7f..4dba2bf7c5d 100644 --- a/Plugins/Detray/CMakeLists.txt +++ b/Plugins/Detray/CMakeLists.txt @@ -1,34 +1,30 @@ -add_library( - ActsPluginDetray SHARED - src/DetrayConverter.cpp) +add_library(ActsPluginDetray SHARED src/DetrayConverter.cpp) -add_dependencies(ActsPluginDetray - detray::core - covfie::core - vecmem::core) +add_dependencies(ActsPluginDetray detray::core covfie::core vecmem::core) target_include_directories( - ActsPluginDetray - PUBLIC - $ - $) + ActsPluginDetray + PUBLIC + $ + $ +) target_link_libraries( - ActsPluginDetray - PUBLIC - ActsCore - ActsPluginJson - detray::core - detray::core_array - detray::io - detray::utils - vecmem::core) + ActsPluginDetray + PUBLIC + ActsCore + ActsPluginJson + detray::core + detray::core_array + detray::io + detray::utils + vecmem::core +) install( - TARGETS ActsPluginDetray - EXPORT ActsPluginDetrayTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsPluginDetray + EXPORT ActsPluginDetrayTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) -install( - DIRECTORY include/Acts - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Plugins/EDM4hep/CMakeLists.txt b/Plugins/EDM4hep/CMakeLists.txt index 090e1531097..bad8460d880 100644 --- a/Plugins/EDM4hep/CMakeLists.txt +++ b/Plugins/EDM4hep/CMakeLists.txt @@ -1,23 +1,19 @@ -add_library( - ActsPluginEDM4hep SHARED - src/EDM4hepUtil.cpp) +add_library(ActsPluginEDM4hep SHARED src/EDM4hepUtil.cpp) target_include_directories( - ActsPluginEDM4hep - PUBLIC - $ - $) + ActsPluginEDM4hep + PUBLIC + $ + $ +) target_link_libraries( - ActsPluginEDM4hep - PUBLIC - ActsCore - ActsPluginPodio - EDM4HEP::edm4hep) + ActsPluginEDM4hep + PUBLIC ActsCore ActsPluginPodio EDM4HEP::edm4hep +) install( - TARGETS ActsPluginEDM4hep - EXPORT ActsPluginEDM4hepTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install( - DIRECTORY include/Acts - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + TARGETS ActsPluginEDM4hep + EXPORT ActsPluginEDM4hepTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Plugins/ExaTrkX/CMakeLists.txt b/Plugins/ExaTrkX/CMakeLists.txt index d2481f585c8..802941e7367 100644 --- a/Plugins/ExaTrkX/CMakeLists.txt +++ b/Plugins/ExaTrkX/CMakeLists.txt @@ -1,99 +1,91 @@ -set(SOURCES - src/buildEdges.cpp - src/ExaTrkXPipeline.cpp -) +set(SOURCES src/buildEdges.cpp src/ExaTrkXPipeline.cpp) if(ACTS_EXATRKX_ENABLE_ONNX) - list(APPEND SOURCES - src/OnnxEdgeClassifier.cpp - src/OnnxMetricLearning.cpp - src/CugraphTrackBuilding.cpp - ) + list( + APPEND + SOURCES + src/OnnxEdgeClassifier.cpp + src/OnnxMetricLearning.cpp + src/CugraphTrackBuilding.cpp + ) endif() if(ACTS_EXATRKX_ENABLE_TORCH) - list(APPEND SOURCES - src/TorchEdgeClassifier.cpp - src/TorchMetricLearning.cpp - src/BoostTrackBuilding.cpp - src/TorchTruthGraphMetricsHook.cpp - src/TorchGraphStoreHook.cpp - ) + list( + APPEND + SOURCES + src/TorchEdgeClassifier.cpp + src/TorchMetricLearning.cpp + src/BoostTrackBuilding.cpp + src/TorchTruthGraphMetricsHook.cpp + src/TorchGraphStoreHook.cpp + ) endif() -add_library( - ActsPluginExaTrkX SHARED - ${SOURCES} -) +add_library(ActsPluginExaTrkX SHARED ${SOURCES}) target_include_directories( - ActsPluginExaTrkX - PUBLIC - $ - $ + ActsPluginExaTrkX + PUBLIC + $ + $ ) target_link_libraries( - ActsPluginExaTrkX - PUBLIC - ActsCore - Boost::boost - ${TORCH_LIBRARIES} # TODO try to make this private again (torch::Device is leaking) - std::filesystem + ActsPluginExaTrkX + PUBLIC + ActsCore + Boost::boost + ${TORCH_LIBRARIES} # TODO try to make this private again (torch::Device is leaking) + std::filesystem ) if(ACTS_EXATRKX_ENABLE_CUDA) - target_link_libraries( - ActsPluginExaTrkX - PRIVATE - frnn - ) - set_target_properties(ActsPluginExaTrkX - PROPERTIES - CUDA_STANDARD 17 - CUDA_STANDARD_REQUIRED ON - CUDA_SEPARABLE_COMPILATION ON - ) - target_compile_definitions(ActsPluginExaTrkX PUBLIC CUDA_API_PER_THREAD_DEFAULT_STREAM) - target_compile_definitions(ActsPluginExaTrkX PUBLIC NO_CUGRAPH_OPS) + target_link_libraries(ActsPluginExaTrkX PRIVATE frnn) + set_target_properties( + ActsPluginExaTrkX + PROPERTIES + CUDA_STANDARD 17 + CUDA_STANDARD_REQUIRED ON + CUDA_SEPARABLE_COMPILATION ON + ) + target_compile_definitions( + ActsPluginExaTrkX + PUBLIC CUDA_API_PER_THREAD_DEFAULT_STREAM + ) + target_compile_definitions(ActsPluginExaTrkX PUBLIC NO_CUGRAPH_OPS) else() - target_compile_definitions(ActsPluginExaTrkX PUBLIC ACTS_EXATRKX_CPUONLY) + target_compile_definitions(ActsPluginExaTrkX PUBLIC ACTS_EXATRKX_CPUONLY) endif() if(ACTS_EXATRKX_ENABLE_ONNX) - target_compile_definitions(ActsPluginExaTrkX PUBLIC ACTS_EXATRKX_ONNX_BACKEND) + target_compile_definitions( + ActsPluginExaTrkX + PUBLIC ACTS_EXATRKX_ONNX_BACKEND + ) - target_link_libraries( - ActsPluginExaTrkX - PRIVATE - OnnxRuntime - cugraph::cugraph - ) + target_link_libraries( + ActsPluginExaTrkX + PRIVATE OnnxRuntime cugraph::cugraph + ) endif() if(ACTS_EXATRKX_ENABLE_TORCH) - target_compile_definitions(ActsPluginExaTrkX PUBLIC ACTS_EXATRKX_TORCH_BACKEND) + target_compile_definitions( + ActsPluginExaTrkX + PUBLIC ACTS_EXATRKX_TORCH_BACKEND + ) - target_link_libraries( - ActsPluginExaTrkX - PRIVATE - TorchScatter::TorchScatter - ) + target_link_libraries(ActsPluginExaTrkX PRIVATE TorchScatter::TorchScatter) - # Should not discard TorchScatter even if its not needed at this point - # since we need the scatter_max operation in the torch script later - target_link_options( - ActsPluginExaTrkX - PUBLIC - "-Wl,-no-as-needed" - ) + # Should not discard TorchScatter even if its not needed at this point + # since we need the scatter_max operation in the torch script later + target_link_options(ActsPluginExaTrkX PUBLIC "-Wl,-no-as-needed") endif() - -install( - TARGETS ActsPluginExaTrkX - EXPORT ActsPluginExaTrkXTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) install( - DIRECTORY include/Acts - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + TARGETS ActsPluginExaTrkX + EXPORT ActsPluginExaTrkXTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Plugins/FpeMonitoring/CMakeLists.txt b/Plugins/FpeMonitoring/CMakeLists.txt index 6486027fd2e..05a6126e2f3 100644 --- a/Plugins/FpeMonitoring/CMakeLists.txt +++ b/Plugins/FpeMonitoring/CMakeLists.txt @@ -1,14 +1,12 @@ -add_library( - ActsPluginFpeMonitoring SHARED - src/FpeMonitor.cpp) +add_library(ActsPluginFpeMonitoring SHARED src/FpeMonitor.cpp) target_include_directories( - ActsPluginFpeMonitoring - PUBLIC - $ - $) + ActsPluginFpeMonitoring + PUBLIC + $ + $ +) -target_link_libraries( - ActsPluginFpeMonitoring PUBLIC ActsCore) +target_link_libraries(ActsPluginFpeMonitoring PUBLIC ActsCore) # Fpe flags set(_fpe_options "") @@ -19,151 +17,176 @@ find_library(dl_LIBRARY dl) find_package(Backtrace) find_program(addr2line_EXECUTABLE addr2line) if(APPLE) - list(APPEND _fpe_options -D_GNU_SOURCE) + list(APPEND _fpe_options -D_GNU_SOURCE) else() + if(dl_LIBRARY) + target_link_libraries(ActsPluginFpeMonitoring PUBLIC ${dl_LIBRARY}) - if(dl_LIBRARY) - target_link_libraries(ActsPluginFpeMonitoring PUBLIC ${dl_LIBRARY}) + set(_backtrace_setup_complete FALSE) - set(_backtrace_setup_complete FALSE) + if(Backtrace_FOUND) + # check if we need to link against bracktrace or not + set(backtrace_include "") - if(Backtrace_FOUND) - - # check if we need to link against bracktrace or not - set(backtrace_include "") - - - file(WRITE - "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" - " + file( + WRITE + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" + " #include int main() {} - " ) - - - message(CHECK_START "Does backtrace work with the default include") - - try_compile(_backtrace_default_header "${CMAKE_BINARY_DIR}" - "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" - LINK_LIBRARIES ${dl_LIBRARY} - COMPILE_DEFINITIONS -DBOOST_STACKTRACE_USE_BACKTRACE - OUTPUT_VARIABLE __OUTPUT) - - - if(_backtrace_default_header) - message(CHECK_PASS "yes") - else() - message(CHECK_FAIL "no") - - file(GLOB hints "/usr/lib/gcc/*/*/include") - find_file(backtrace_header "backtrace.h" - HINTS ${hints}) - - if(${backtrace_header} STREQUAL "backtrcae_header-NOTFOUND") - message(STATUS "Could not find backtrace header file") - else() - set(backtrace_include "-DBOOST_STACKTRACE_BACKTRACE_INCLUDE_FILE=\"${backtrace_header}\"") - - - file(WRITE - "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" - " + " + ) + + message(CHECK_START "Does backtrace work with the default include") + + try_compile( + _backtrace_default_header + "${CMAKE_BINARY_DIR}" + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" + LINK_LIBRARIES ${dl_LIBRARY} + COMPILE_DEFINITIONS -DBOOST_STACKTRACE_USE_BACKTRACE + OUTPUT_VARIABLE __OUTPUT + ) + + if(_backtrace_default_header) + message(CHECK_PASS "yes") + else() + message(CHECK_FAIL "no") + + file(GLOB hints "/usr/lib/gcc/*/*/include") + find_file(backtrace_header "backtrace.h" HINTS ${hints}) + + if(${backtrace_header} STREQUAL "backtrcae_header-NOTFOUND") + message(STATUS "Could not find backtrace header file") + else() + set(backtrace_include + "-DBOOST_STACKTRACE_BACKTRACE_INCLUDE_FILE=\"${backtrace_header}\"" + ) + + file( + WRITE + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" + " #include int main() {} - " ) - - - message(CHECK_START "Does backtrace work with explicit include") - - try_compile(_backtrace_explicit_header "${CMAKE_BINARY_DIR}" - "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" - LINK_LIBRARIES ${dl_LIBRARY} - COMPILE_DEFINITIONS -DBOOST_STACKTRACE_USE_BACKTRACE ${backtrace_include} - OUTPUT_VARIABLE __OUTPUT) - - if(_backtrace_explicit_header) - message(CHECK_PASS "yes") - list(APPEND _fpe_options "${backtrace_include}") - else() - message(CHECK_FAIL "no") - endif() + " + ) + + message( + CHECK_START + "Does backtrace work with explicit include" + ) + + try_compile( + _backtrace_explicit_header + "${CMAKE_BINARY_DIR}" + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" + LINK_LIBRARIES ${dl_LIBRARY} + COMPILE_DEFINITIONS + -DBOOST_STACKTRACE_USE_BACKTRACE + ${backtrace_include} + OUTPUT_VARIABLE __OUTPUT + ) + + if(_backtrace_explicit_header) + message(CHECK_PASS "yes") + list(APPEND _fpe_options "${backtrace_include}") + else() + message(CHECK_FAIL "no") + endif() + endif() + endif() + + file( + WRITE + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" + "#include \n" + "#include \n" + "int main() { std::cout << boost::stacktrace::stacktrace(); }\n" + ) + + message(CHECK_START "Does backtrace work without linker flag") + try_compile( + _backtrace_nolink + "${CMAKE_BINARY_DIR}" + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" + LINK_LIBRARIES ${dl_LIBRARY} + COMPILE_DEFINITIONS + -DBOOST_STACKTRACE_USE_BACKTRACE + ${backtrace_include} + OUTPUT_VARIABLE __OUTPUT + ) + + if(_backtrace_nolink) + message(CHECK_PASS "yes") + set(_backtrace_setup_complete TRUE) + else() + message(CHECK_FAIL "no") + + file( + WRITE + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" + "#include \n" + "#include \n" + "int main() { std::cout << boost::stacktrace::stacktrace(); }\n" + ) + + message(CHECK_START "Does backtrace work with linker flag") + try_compile( + _backtrace_link + "${CMAKE_BINARY_DIR}" + "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" + LINK_LIBRARIES backtrace ${dl_LIBRARY} + COMPILE_DEFINITIONS + -DBOOST_STACKTRACE_USE_BACKTRACE + ${backtrace_include} + OUTPUT_VARIABLE __OUTPUT + ) + + if(_backtrace_link) + message(CHECK_PASS "yes") + list(APPEND _fpe_options -DBOOST_STACKTRACE_USE_BACKTRACE) + target_link_libraries( + ActsPluginFpeMonitoring + PUBLIC backtrace + ) + + set(_backtrace_setup_complete TRUE) + else() + message(CHECK_FAIL "no") + endif() + endif() endif() - endif() - - - file(WRITE - "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" - "#include \n" - "#include \n" - "int main() { std::cout << boost::stacktrace::stacktrace(); }\n" ) - - message(CHECK_START "Does backtrace work without linker flag") - try_compile(_backtrace_nolink "${CMAKE_BINARY_DIR}" - "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" - LINK_LIBRARIES ${dl_LIBRARY} - COMPILE_DEFINITIONS -DBOOST_STACKTRACE_USE_BACKTRACE ${backtrace_include} - OUTPUT_VARIABLE __OUTPUT) - - if(_backtrace_nolink) - message(CHECK_PASS "yes") - set(_backtrace_setup_complete TRUE) - else() - message(CHECK_FAIL "no") - - file(WRITE - "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" - "#include \n" - "#include \n" - "int main() { std::cout << boost::stacktrace::stacktrace(); }\n" ) - - message(CHECK_START "Does backtrace work with linker flag") - try_compile(_backtrace_link "${CMAKE_BINARY_DIR}" - "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/backtrace.cpp" - LINK_LIBRARIES backtrace ${dl_LIBRARY} - COMPILE_DEFINITIONS -DBOOST_STACKTRACE_USE_BACKTRACE ${backtrace_include} - OUTPUT_VARIABLE __OUTPUT) - - if(_backtrace_link) - message(CHECK_PASS "yes") - list(APPEND _fpe_options -DBOOST_STACKTRACE_USE_BACKTRACE) - target_link_libraries(ActsPluginFpeMonitoring PUBLIC backtrace) - - set(_backtrace_setup_complete TRUE) - else() - message(CHECK_FAIL "no") + if(NOT _backtrace_setup_complete) + message(CHECK_START "Is addr2line available") + if(addr2line_EXECUTABLE) + list(APPEND _fpe_options -DBOOST_STACKTRACE_USE_ADDR2LINE) + list( + APPEND + _fpe_options + -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=${addr2line_EXECUTABLE} + ) + message(CHECK_PASS "yes") + + set(_backtrace_setup_complete TRUE) + else() + message(CHECK_FAIL "no") + endif() endif() - endif() - endif() - - if(NOT _backtrace_setup_complete) - message(CHECK_START "Is addr2line available") - if(addr2line_EXECUTABLE) - list(APPEND _fpe_options -DBOOST_STACKTRACE_USE_ADDR2LINE) - list(APPEND _fpe_options -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=${addr2line_EXECUTABLE}) - message(CHECK_PASS "yes") - - set(_backtrace_setup_complete TRUE) - else() - message(CHECK_FAIL "no") - endif() - endif() - - if(NOT _backtrace_setup_complete) - message(STATUS "Unable to set up stacktrace setup: use noop") - list(APPEND _fpe_options -BOOST_STACKTRACE_USE_NOOP) + if(NOT _backtrace_setup_complete) + message(STATUS "Unable to set up stacktrace setup: use noop") + list(APPEND _fpe_options -BOOST_STACKTRACE_USE_NOOP) + endif() endif() - endif() endif() target_compile_options(ActsPluginFpeMonitoring PUBLIC "${_fpe_options}") - -install( - TARGETS ActsPluginFpeMonitoring - EXPORT ActsPluginFpeMonitoringTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) install( - DIRECTORY include/Acts - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + TARGETS ActsPluginFpeMonitoring + EXPORT ActsPluginFpeMonitoringTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Plugins/Geant4/CMakeLists.txt b/Plugins/Geant4/CMakeLists.txt index dc4e35c9fa2..c92adbdb525 100644 --- a/Plugins/Geant4/CMakeLists.txt +++ b/Plugins/Geant4/CMakeLists.txt @@ -1,27 +1,29 @@ include(FetchContent) add_library( - ActsPluginGeant4 SHARED - src/Geant4Converters.cpp - src/Geant4DetectorElement.cpp - src/Geant4DetectorSurfaceFactory.cpp - src/Geant4PhysicalVolumeSelectors.cpp) + ActsPluginGeant4 + SHARED + src/Geant4Converters.cpp + src/Geant4DetectorElement.cpp + src/Geant4DetectorSurfaceFactory.cpp + src/Geant4PhysicalVolumeSelectors.cpp +) target_include_directories( ActsPluginGeant4 - PUBLIC - $ - $) + PUBLIC + $ + $ +) target_include_directories( - ActsPluginGeant4 - SYSTEM PRIVATE ${Geant4_INCLUDE_DIRS}) -target_link_libraries( ActsPluginGeant4 - PUBLIC ActsCore ${Geant4_LIBRARIES}) + SYSTEM + PRIVATE ${Geant4_INCLUDE_DIRS} +) +target_link_libraries(ActsPluginGeant4 PUBLIC ActsCore ${Geant4_LIBRARIES}) install( - TARGETS ActsPluginGeant4 - EXPORT ActsPluginGeant4Targets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install( - DIRECTORY include/Acts - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + TARGETS ActsPluginGeant4 + EXPORT ActsPluginGeant4Targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Plugins/GeoModel/CMakeLists.txt b/Plugins/GeoModel/CMakeLists.txt index eda838bac65..5e40ade3230 100644 --- a/Plugins/GeoModel/CMakeLists.txt +++ b/Plugins/GeoModel/CMakeLists.txt @@ -1,33 +1,40 @@ include(FetchContent) add_library( - ActsPluginGeoModel SHARED - src/GeoModelBlueprintCreater.cpp - src/GeoModelConversionError.cpp - src/GeoModelReader.cpp - src/GeoModelDetectorElement.cpp - src/GeoModelDetectorSurfaceFactory.cpp - src/detail/GeoBoxConverter.cpp - src/detail/GeoTrdConverter.cpp - src/detail/GeoTubeConverter.cpp - src/detail/GeoShiftConverter.cpp - src/detail/GeoIntersectionAnnulusConverter.cpp - src/detail/GeoModelBinningHelper.cpp - src/detail/GeoModelExtentHelper.cpp - src/detail/GeoUnionDoubleTrdConverter.cpp) + ActsPluginGeoModel + SHARED + src/GeoModelBlueprintCreater.cpp + src/GeoModelConversionError.cpp + src/GeoModelReader.cpp + src/GeoModelDetectorElement.cpp + src/GeoModelDetectorSurfaceFactory.cpp + src/detail/GeoBoxConverter.cpp + src/detail/GeoTrdConverter.cpp + src/detail/GeoTubeConverter.cpp + src/detail/GeoShiftConverter.cpp + src/detail/GeoIntersectionAnnulusConverter.cpp + src/detail/GeoModelBinningHelper.cpp + src/detail/GeoModelExtentHelper.cpp + src/detail/GeoUnionDoubleTrdConverter.cpp +) target_include_directories( ActsPluginGeoModel - PUBLIC - $ - $) + PUBLIC + $ + $ +) target_link_libraries( ActsPluginGeoModel - PUBLIC ActsCore GeoModelCore::GeoModelKernel GeoModelIO::GeoModelDBManager GeoModelIO::GeoModelRead) + PUBLIC + ActsCore + GeoModelCore::GeoModelKernel + GeoModelIO::GeoModelDBManager + GeoModelIO::GeoModelRead +) install( - TARGETS ActsPluginGeoModel - EXPORT ActsPluginGeoModelTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install( - DIRECTORY include/Acts - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + TARGETS ActsPluginGeoModel + EXPORT ActsPluginGeoModelTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Plugins/Json/CMakeLists.txt b/Plugins/Json/CMakeLists.txt index 3b7f495b1c5..0d3ff9875ee 100644 --- a/Plugins/Json/CMakeLists.txt +++ b/Plugins/Json/CMakeLists.txt @@ -1,41 +1,46 @@ include(ActsTargetLinkLibrariesSystem) add_library( - ActsPluginJson SHARED - src/AlgebraJsonConverter.cpp - src/DetectorJsonConverter.cpp - src/DetectorVolumeJsonConverter.cpp - src/ExtentJsonConverter.cpp - src/GridJsonConverter.cpp - src/DetectorVolumeFinderJsonConverter.cpp - src/IndexedSurfacesJsonConverter.cpp - src/JsonMaterialDecorator.cpp - src/MaterialMapJsonConverter.cpp - src/MaterialJsonConverter.cpp - src/PortalJsonConverter.cpp - src/ProtoDetectorJsonConverter.cpp - src/SurfaceBoundsJsonConverter.cpp - src/SurfaceJsonConverter.cpp - src/UtilitiesJsonConverter.cpp - src/VolumeBoundsJsonConverter.cpp - src/VolumeJsonConverter.cpp - src/AmbiguityConfigJsonConverter.cpp - src/DetrayJsonHelper.cpp) + ActsPluginJson + SHARED + src/AlgebraJsonConverter.cpp + src/DetectorJsonConverter.cpp + src/DetectorVolumeJsonConverter.cpp + src/ExtentJsonConverter.cpp + src/GridJsonConverter.cpp + src/DetectorVolumeFinderJsonConverter.cpp + src/IndexedSurfacesJsonConverter.cpp + src/JsonMaterialDecorator.cpp + src/MaterialMapJsonConverter.cpp + src/MaterialJsonConverter.cpp + src/PortalJsonConverter.cpp + src/ProtoDetectorJsonConverter.cpp + src/SurfaceBoundsJsonConverter.cpp + src/SurfaceJsonConverter.cpp + src/UtilitiesJsonConverter.cpp + src/VolumeBoundsJsonConverter.cpp + src/VolumeJsonConverter.cpp + src/AmbiguityConfigJsonConverter.cpp + src/DetrayJsonHelper.cpp +) target_include_directories( - ActsPluginJson - PUBLIC - $ - $) + ActsPluginJson + PUBLIC + $ + $ +) target_link_libraries( - ActsPluginJson PUBLIC ActsCore nlohmann_json::nlohmann_json) + ActsPluginJson + PUBLIC ActsCore nlohmann_json::nlohmann_json +) target_compile_definitions( - ActsPluginJson - PRIVATE JSON_DISABLE_ENUM_SERIALIZATION=1) + ActsPluginJson + PRIVATE JSON_DISABLE_ENUM_SERIALIZATION=1 +) install( - TARGETS ActsPluginJson - EXPORT ActsPluginJsonTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install( - DIRECTORY include/Acts - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + TARGETS ActsPluginJson + EXPORT ActsPluginJsonTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Plugins/Legacy/CMakeLists.txt b/Plugins/Legacy/CMakeLists.txt index c280b0d0c8d..430c1ad4fad 100644 --- a/Plugins/Legacy/CMakeLists.txt +++ b/Plugins/Legacy/CMakeLists.txt @@ -1,21 +1,16 @@ -add_library( - ActsPluginLegacy INTERFACE) -target_compile_features( - ActsPluginLegacy - INTERFACE cxx_std_17) +add_library(ActsPluginLegacy INTERFACE) +target_compile_features(ActsPluginLegacy INTERFACE cxx_std_17) target_include_directories( - ActsPluginLegacy - INTERFACE - $ - $) -target_link_libraries( - ActsPluginLegacy - INTERFACE Boost::boost Eigen3::Eigen) + ActsPluginLegacy + INTERFACE + $ + $ +) +target_link_libraries(ActsPluginLegacy INTERFACE Boost::boost Eigen3::Eigen) install( - TARGETS ActsPluginLegacy - EXPORT ActsPluginLegacyTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install( - DIRECTORY include/Acts - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + TARGETS ActsPluginLegacy + EXPORT ActsPluginLegacyTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Plugins/Onnx/CMakeLists.txt b/Plugins/Onnx/CMakeLists.txt index f4b756fb38a..3a07262ac71 100644 --- a/Plugins/Onnx/CMakeLists.txt +++ b/Plugins/Onnx/CMakeLists.txt @@ -1,29 +1,29 @@ add_library( - ActsPluginOnnx SHARED - # header files - include/Acts/Plugins/Onnx/OnnxRuntimeBase.hpp - include/Acts/Plugins/Onnx/MLTrackClassifier.hpp - include/Acts/Plugins/Onnx/AmbiguityTrackClassifier.hpp - include/Acts/Plugins/Onnx/SeedClassifier.hpp - # source files - src/OnnxRuntimeBase.cpp - src/MLTrackClassifier.cpp) + ActsPluginOnnx + SHARED + # header files + include/Acts/Plugins/Onnx/OnnxRuntimeBase.hpp + include/Acts/Plugins/Onnx/MLTrackClassifier.hpp + include/Acts/Plugins/Onnx/AmbiguityTrackClassifier.hpp + include/Acts/Plugins/Onnx/SeedClassifier.hpp + # source files + src/OnnxRuntimeBase.cpp + src/MLTrackClassifier.cpp +) target_include_directories( - ActsPluginOnnx - PUBLIC - $ - $) + ActsPluginOnnx + PUBLIC + $ + $ +) -target_link_libraries( - ActsPluginOnnx - PUBLIC ActsCore OnnxRuntime) +target_link_libraries(ActsPluginOnnx PUBLIC ActsCore OnnxRuntime) install( - TARGETS ActsPluginOnnx - EXPORT ActsPluginOnnxTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ActsPluginOnnx + EXPORT ActsPluginOnnxTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) -install( - DIRECTORY include/Acts - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Plugins/Podio/CMakeLists.txt b/Plugins/Podio/CMakeLists.txt index 606f488f1f3..18630685929 100644 --- a/Plugins/Podio/CMakeLists.txt +++ b/Plugins/Podio/CMakeLists.txt @@ -1,23 +1,18 @@ -add_library( - ActsPluginPodio SHARED - src/PodioUtil.cpp -) +add_library(ActsPluginPodio SHARED src/PodioUtil.cpp) target_include_directories( - ActsPluginPodio - PUBLIC - $ - $) -target_link_libraries( - ActsPluginPodio - PUBLIC ActsCore) + ActsPluginPodio + PUBLIC + $ + $ +) +target_link_libraries(ActsPluginPodio PUBLIC ActsCore) # target_link_libraries(ActsPluginEDM4hep PUBLIC EDM4HEP::edm4hep) - # message(STATUS "IO HANDLERS: ${PODIO_IO_HANDLERS}") -PODIO_GENERATE_DATAMODEL( +podio_generate_datamodel( ActsPodioEdm ${CMAKE_CURRENT_LIST_DIR}/edm.yml headers @@ -25,54 +20,58 @@ PODIO_GENERATE_DATAMODEL( IO_BACKEND_HANDLERS ${PODIO_IO_HANDLERS} ) -PODIO_ADD_DATAMODEL_CORE_LIB(ActsPodioEdm "${headers}" "${sources}") +podio_add_datamodel_core_lib(ActsPodioEdm "${headers}" "${sources}") -target_link_libraries(ActsPluginPodio PUBLIC - ActsPodioEdm - ROOT::Core - podio::podio - podio::podioRootIO +target_link_libraries( + ActsPluginPodio + PUBLIC ActsPodioEdm ROOT::Core podio::podio podio::podioRootIO ) -PODIO_ADD_ROOT_IO_DICT(ActsPodioEdmDict ActsPodioEdm "${headers}" src/selection.xml) +podio_add_root_io_dict(ActsPodioEdmDict ActsPodioEdm "${headers}" src/selection.xml) add_library(Acts::ActsPodioEdmDict ALIAS ActsPodioEdmDict) install( - TARGETS ActsPodioEdm - EXPORT ActsPodioEdmTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ActsPodioEdm) + TARGETS ActsPodioEdm + EXPORT ActsPodioEdmTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ActsPodioEdm +) install( - DIRECTORY ActsPodioEdm - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ActsPodioEdm) + DIRECTORY ActsPodioEdm + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ActsPodioEdm +) set(install_package_config_dir "${CMAKE_INSTALL_LIBDIR}/cmake/Acts") -install( - EXPORT ActsPodioEdmTargets - DESTINATION ${install_package_config_dir}) +install(EXPORT ActsPodioEdmTargets DESTINATION ${install_package_config_dir}) install( - TARGETS ActsPluginPodio - EXPORT ActsPluginPodioTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install( - DIRECTORY include/Acts - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + TARGETS ActsPluginPodio + EXPORT ActsPluginPodioTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -install(TARGETS ActsPodioEdmDict - EXPORT ActsPodioEdmTargets - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib - PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ActsPodioEdm" - COMPONENT dev) +install( + TARGETS ActsPodioEdmDict + EXPORT ActsPodioEdmTargets + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib + PUBLIC_HEADER + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ActsPodioEdm" + COMPONENT dev +) -install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/ActsPodioEdmDictDict.rootmap" - DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT dev) +install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/ActsPodioEdmDictDict.rootmap" + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT dev +) -if (${ROOT_VERSION} GREATER 6) - install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/libActsPodioEdmDict_rdict.pcm" - DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT dev) +if(${ROOT_VERSION} GREATER 6) + install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/libActsPodioEdmDict_rdict.pcm" + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT dev + ) endif() diff --git a/Plugins/TGeo/CMakeLists.txt b/Plugins/TGeo/CMakeLists.txt index cd61a3839b1..d30bff15c76 100644 --- a/Plugins/TGeo/CMakeLists.txt +++ b/Plugins/TGeo/CMakeLists.txt @@ -1,37 +1,36 @@ - set(library_sources - src/TGeoCylinderDiscSplitter.cpp - src/TGeoDetectorElement.cpp - src/TGeoLayerBuilder.cpp - src/TGeoParser.cpp - src/TGeoPrimitivesHelper.cpp - src/TGeoSurfaceConverter.cpp) + src/TGeoCylinderDiscSplitter.cpp + src/TGeoDetectorElement.cpp + src/TGeoLayerBuilder.cpp + src/TGeoParser.cpp + src/TGeoPrimitivesHelper.cpp + src/TGeoSurfaceConverter.cpp +) # Internal system of units change, This behavior affected versions up to v6-25-01 # see: https://root.cern.ch/doc/v626/classTGeoMaterial.html -if (${ROOT_VERSION} VERSION_GREATER "6.25.01") - list(APPEND library_sources src/TGeoMaterialConverter.cpp) -else () - message(INFO " Skipping TGeoMaterialConverter due to ROOT version ${ROOT_VERSION}") +if(${ROOT_VERSION} VERSION_GREATER "6.25.01") + list(APPEND library_sources src/TGeoMaterialConverter.cpp) +else() + message( + INFO + " Skipping TGeoMaterialConverter due to ROOT version ${ROOT_VERSION}" + ) endif() -add_library( - ActsPluginTGeo SHARED ${library_sources}) - +add_library(ActsPluginTGeo SHARED ${library_sources}) target_include_directories( - ActsPluginTGeo - PUBLIC - $ - $) -target_link_libraries( - ActsPluginTGeo - PUBLIC ActsCore ROOT::Geom) + ActsPluginTGeo + PUBLIC + $ + $ +) +target_link_libraries(ActsPluginTGeo PUBLIC ActsCore ROOT::Geom) install( - TARGETS ActsPluginTGeo - EXPORT ActsPluginTGeoTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install( - DIRECTORY include/Acts - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + TARGETS ActsPluginTGeo + EXPORT ActsPluginTGeoTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) +install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/Tests/Benchmarks/CMakeLists.txt b/Tests/Benchmarks/CMakeLists.txt index 4955febba09..8906375caea 100644 --- a/Tests/Benchmarks/CMakeLists.txt +++ b/Tests/Benchmarks/CMakeLists.txt @@ -1,23 +1,23 @@ # benchmarks tests are not registered with a common target # add an benchmark executable w/ default dependencies macro(add_benchmark _name) - # automatically prefix the target name - set(_target "ActsBenchmark${_name}") - add_executable(${_target} ${ARGN}) - # define required BOOST_TEST_... macros here to ensure consistent names - target_compile_definitions( - ${_target} - PRIVATE "-DBOOST_TEST_DYN_LINK" "-DBOOST_TEST_MODULE=${_target}") - target_include_directories( - ${_target} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries( - ${_target} - PRIVATE - ActsCore - ActsTestsCommonHelpers - Boost::program_options - Boost::unit_test_framework) + # automatically prefix the target name + set(_target "ActsBenchmark${_name}") + add_executable(${_target} ${ARGN}) + # define required BOOST_TEST_... macros here to ensure consistent names + target_compile_definitions( + ${_target} + PRIVATE "-DBOOST_TEST_DYN_LINK" "-DBOOST_TEST_MODULE=${_target}" + ) + target_include_directories(${_target} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + target_link_libraries( + ${_target} + PRIVATE + ActsCore + ActsTestsCommonHelpers + Boost::program_options + Boost::unit_test_framework + ) endmacro() add_benchmark(AtlasStepper AtlasStepperBenchmark.cpp) diff --git a/Tests/CommonHelpers/CMakeLists.txt b/Tests/CommonHelpers/CMakeLists.txt index fc09c3e5ffa..12d42d851ab 100644 --- a/Tests/CommonHelpers/CMakeLists.txt +++ b/Tests/CommonHelpers/CMakeLists.txt @@ -2,18 +2,22 @@ file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../Data" acts_test_data_dir) add_library( - ActsTestsCommonHelpers SHARED - Acts/Tests/CommonHelpers/DataDirectory.cpp + ActsTestsCommonHelpers + SHARED + Acts/Tests/CommonHelpers/DataDirectory.cpp ) target_compile_definitions( - ActsTestsCommonHelpers - PRIVATE - "ACTS_TEST_DATA_DIR=\"${acts_test_data_dir}\"" - BOOST_FILESYSTEM_NO_DEPRECATED) + ActsTestsCommonHelpers + PRIVATE + "ACTS_TEST_DATA_DIR=\"${acts_test_data_dir}\"" + BOOST_FILESYSTEM_NO_DEPRECATED +) target_include_directories( - ActsTestsCommonHelpers - PUBLIC $) + ActsTestsCommonHelpers + PUBLIC $ +) target_link_libraries( - ActsTestsCommonHelpers - PUBLIC ActsCore - PRIVATE std::filesystem) + ActsTestsCommonHelpers + PUBLIC ActsCore + PRIVATE std::filesystem +) diff --git a/Tests/DownstreamProject/CMakeLists.txt b/Tests/DownstreamProject/CMakeLists.txt index 53b805e674b..27f2f10583b 100644 --- a/Tests/DownstreamProject/CMakeLists.txt +++ b/Tests/DownstreamProject/CMakeLists.txt @@ -4,48 +4,46 @@ project(ActsDownstreamProject) # find all optional components that are build find_package( - Acts CONFIG REQUIRED - COMPONENTS - Core - Fatras - PluginJson - PluginLegacy - PluginTGeo) + Acts + CONFIG + REQUIRED + COMPONENTS Core Fatras PluginJson PluginLegacy PluginTGeo +) # place artifacts in GNU-like paths, e.g. binaries in `/bin` include(GNUInstallDirs) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}") -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY + "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}" +) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY + "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}" +) # link with all optional components even when they are not really used # to check e.g. for possible linker issues add_executable(ShowActsVersion ShowActsVersion.cpp) target_link_libraries( - ShowActsVersion - PRIVATE - ActsCore - ActsFatras - ActsPluginJson - ActsPluginLegacy - ActsPluginTGeo) + ShowActsVersion + PRIVATE ActsCore ActsFatras ActsPluginJson ActsPluginLegacy ActsPluginTGeo +) option(DD4HEP "Build with DD4hep" ON) if(DD4HEP) - message(STATUS "Adding DD4hep plugin") - find_package(Acts CONFIG REQUIRED COMPONENTS PluginDD4hep) - target_link_libraries( ShowActsVersion PRIVATE ActsPluginDD4hep) + message(STATUS "Adding DD4hep plugin") + find_package(Acts CONFIG REQUIRED COMPONENTS PluginDD4hep) + target_link_libraries(ShowActsVersion PRIVATE ActsPluginDD4hep) endif() option(PODIO "Build with podio" ON) if(PODIO) - message(STATUS "Adding podio plugin") - find_package(Acts CONFIG REQUIRED COMPONENTS PluginPodio) - target_link_libraries( ShowActsVersion PRIVATE ActsPluginPodio) + message(STATUS "Adding podio plugin") + find_package(Acts CONFIG REQUIRED COMPONENTS PluginPodio) + target_link_libraries(ShowActsVersion PRIVATE ActsPluginPodio) endif() option(EDM4HEP "Build with EDM4hep" ON) if(EDM4HEP) - message(STATUS "Adding EDM4hep plugin") - find_package(Acts CONFIG REQUIRED COMPONENTS PluginEDM4hep) - target_link_libraries( ShowActsVersion PRIVATE ActsPluginEDM4hep) + message(STATUS "Adding EDM4hep plugin") + find_package(Acts CONFIG REQUIRED COMPONENTS PluginEDM4hep) + target_link_libraries(ShowActsVersion PRIVATE ActsPluginEDM4hep) endif() diff --git a/Tests/DownstreamProjectNodeps/CMakeLists.txt b/Tests/DownstreamProjectNodeps/CMakeLists.txt index 4ac08153d63..909fdbd5d2d 100644 --- a/Tests/DownstreamProjectNodeps/CMakeLists.txt +++ b/Tests/DownstreamProjectNodeps/CMakeLists.txt @@ -6,8 +6,15 @@ find_package(Acts CONFIG REQUIRED COMPONENTS Core) # place artifacts in GNU-like paths, e.g. binaries in `/bin` include(GNUInstallDirs) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}") -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY + "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}" +) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY + "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}" +) add_executable(ShowActsVersion ShowActsVersion.cpp) -target_link_libraries(ShowActsVersion PRIVATE ActsCore Boost::boost Eigen3::Eigen) +target_link_libraries( + ShowActsVersion + PRIVATE ActsCore Boost::boost Eigen3::Eigen +) diff --git a/Tests/IntegrationTests/CMakeLists.txt b/Tests/IntegrationTests/CMakeLists.txt index d62f027fa95..fb5c84492d2 100644 --- a/Tests/IntegrationTests/CMakeLists.txt +++ b/Tests/IntegrationTests/CMakeLists.txt @@ -7,27 +7,27 @@ add_custom_target(integrationtests) # extended by setting the `integrationtest_extra_libraries` variables before # calling the macro. macro(add_integrationtest _name) - # automatically prefix the target name - set(_target "ActsIntegrationTest${_name}") - add_executable(${_target} ${ARGN}) - # define required BOOST_TEST_... macros here to ensure consistent names - target_compile_definitions( - ${_target} - PRIVATE "-DBOOST_TEST_DYN_LINK" "-DBOOST_TEST_MODULE=${_target}") - target_include_directories( - ${_target} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries( - ${_target} - PRIVATE - ActsCore - ActsTestsCommonHelpers - Boost::unit_test_framework - ${integrationtest_extra_libraries}) - # register as integration test executable - set(_run "RunIntegrationTest${_name}") - add_custom_target(${_run} COMMAND ${_target}) - add_dependencies(integrationtests ${_run}) + # automatically prefix the target name + set(_target "ActsIntegrationTest${_name}") + add_executable(${_target} ${ARGN}) + # define required BOOST_TEST_... macros here to ensure consistent names + target_compile_definitions( + ${_target} + PRIVATE "-DBOOST_TEST_DYN_LINK" "-DBOOST_TEST_MODULE=${_target}" + ) + target_include_directories(${_target} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + target_link_libraries( + ${_target} + PRIVATE + ActsCore + ActsTestsCommonHelpers + Boost::unit_test_framework + ${integrationtest_extra_libraries} + ) + # register as integration test executable + set(_run "RunIntegrationTest${_name}") + add_custom_target(${_run} COMMAND ${_target}) + add_dependencies(integrationtests ${_run}) endmacro() add_integrationtest(InterpolatedSolenoidBField InterpolatedSolenoidBFieldTest.cpp) diff --git a/Tests/UnitTests/CMakeLists.txt b/Tests/UnitTests/CMakeLists.txt index f986c6f5418..daff8b028e9 100644 --- a/Tests/UnitTests/CMakeLists.txt +++ b/Tests/UnitTests/CMakeLists.txt @@ -7,28 +7,27 @@ add_custom_target(unit_tests) macro(add_unittest _name _source) - # automatically prefix the target name - set(_target "ActsUnitTest${_name}") - add_executable(${_target} ${_source}) - # define required BOOST_TEST_... macros here to ensure consistent names - target_compile_definitions( - ${_target} - PRIVATE "-DBOOST_TEST_DYN_LINK") - set_source_files_properties(${_source} PROPERTIES - COMPILE_DEFINITIONS "BOOST_TEST_MODULE=${_target}") - target_include_directories( - ${_target} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries( - ${_target} - PRIVATE - ActsCore - ActsTestsCommonHelpers - Boost::unit_test_framework - ${unittest_extra_libraries}) - # register as unittest executable - add_test(NAME ${_name} COMMAND ${_target}) - add_dependencies(unit_tests ${_target}) + # automatically prefix the target name + set(_target "ActsUnitTest${_name}") + add_executable(${_target} ${_source}) + # define required BOOST_TEST_... macros here to ensure consistent names + target_compile_definitions(${_target} PRIVATE "-DBOOST_TEST_DYN_LINK") + set_source_files_properties( + ${_source} + PROPERTIES COMPILE_DEFINITIONS "BOOST_TEST_MODULE=${_target}" + ) + target_include_directories(${_target} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + target_link_libraries( + ${_target} + PRIVATE + ActsCore + ActsTestsCommonHelpers + Boost::unit_test_framework + ${unittest_extra_libraries} + ) + # register as unittest executable + add_test(NAME ${_name} COMMAND ${_target}) + add_dependencies(unit_tests ${_target}) endmacro() # This function adds a non compile test. To this end it @@ -41,74 +40,90 @@ endmacro() # - Adds a closure test where it's supposed to actually compile if all of the # critical sections are removed function(add_non_compile_test name src) - - # Don't add anything if the corresponding flag is not set - if(NOT ACTS_BUILD_NONCOMPILE_TESTS) - return() - endif() - - # Figure out where to put the output file - cmake_path(ABSOLUTE_PATH src) - get_filename_component(_filename ${src} NAME) - set(_processed_source "${CMAKE_CURRENT_BINARY_DIR}/${_filename}") - - # Add a build step to generate the source file by invoking a CMake script - add_custom_command( - OUTPUT ${_processed_source} - DEPENDS ${src} - COMMAND "${CMAKE_COMMAND}" - -DINPUT_FILE=${src} - -DOUTPUT_FILE=${_processed_source} - -P ${CMAKE_SOURCE_DIR}/cmake/ActsGenerateNonCompileTest.cmake - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - ) - add_custom_target( - "${name}_generated_source" - DEPENDS ${_processed_source} - ) - - # Create the executable target, add the generated source code as a - # dependencies, so that it's generated when required. - set(test "ActsNonCompileTest${name}Closure") - set(target "${test}_Executable") - add_executable(${target} ${_processed_source}) - target_link_libraries(${target} PUBLIC ActsCore ActsTestsCommonHelpers) - add_dependencies(${target} "${name}_generated_source") - - # Don't build this target by default - set_target_properties(${target} PROPERTIES - EXCLUDE_FROM_ALL ON - EXCLUDE_FROM_DEFAULT_BUILD ON) - - # Add the test that calls into CMake to build the target. This one we expect to succeed - add_test(NAME ${test} - COMMAND ${CMAKE_COMMAND} --build . --target ${target} --config $ - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) - - # Loop over critical section markers and add one pair of executable targets and - # and test jobs. The test jobs are flipped, so success is failure. - file(READ ${src} content) - string(REGEX MATCHALL "ACTS_DOES_NOT_COMPILE_BEGIN\\(([A-Za-z0-9]+)\\)" matches ${content}) - foreach(match ${matches}) - string(REGEX REPLACE "ACTS_DOES_NOT_COMPILE_BEGIN\\(([A-Za-z0-9]+)\\)" "\\1" match ${match}) - - set(test "ActsNonCompileTest${name}${match}") + # Don't add anything if the corresponding flag is not set + if(NOT ACTS_BUILD_NONCOMPILE_TESTS) + return() + endif() + + # Figure out where to put the output file + cmake_path(ABSOLUTE_PATH src) + get_filename_component(_filename ${src} NAME) + set(_processed_source "${CMAKE_CURRENT_BINARY_DIR}/${_filename}") + + # Add a build step to generate the source file by invoking a CMake script + add_custom_command( + OUTPUT ${_processed_source} + DEPENDS ${src} + COMMAND + "${CMAKE_COMMAND}" -DINPUT_FILE=${src} + -DOUTPUT_FILE=${_processed_source} -P + ${CMAKE_SOURCE_DIR}/cmake/ActsGenerateNonCompileTest.cmake + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + add_custom_target("${name}_generated_source" DEPENDS ${_processed_source}) + + # Create the executable target, add the generated source code as a + # dependencies, so that it's generated when required. + set(test "ActsNonCompileTest${name}Closure") set(target "${test}_Executable") add_executable(${target} ${_processed_source}) target_link_libraries(${target} PUBLIC ActsCore ActsTestsCommonHelpers) - target_compile_definitions(${target} PRIVATE "-D${match}") add_dependencies(${target} "${name}_generated_source") - set_target_properties(${target} PROPERTIES - EXCLUDE_FROM_ALL ON - EXCLUDE_FROM_DEFAULT_BUILD ON) - - add_test(NAME ${test} - COMMAND ${CMAKE_COMMAND} --build . --target ${target} --config $ - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) - set_tests_properties(${test} PROPERTIES WILL_FAIL ON) - endforeach() - + # Don't build this target by default + set_target_properties( + ${target} + PROPERTIES EXCLUDE_FROM_ALL ON EXCLUDE_FROM_DEFAULT_BUILD ON + ) + + # Add the test that calls into CMake to build the target. This one we expect to succeed + add_test( + NAME ${test} + COMMAND + ${CMAKE_COMMAND} --build . --target ${target} --config + $ + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + + # Loop over critical section markers and add one pair of executable targets and + # and test jobs. The test jobs are flipped, so success is failure. + file(READ ${src} content) + string( + REGEX MATCHALL + "ACTS_DOES_NOT_COMPILE_BEGIN\\(([A-Za-z0-9]+)\\)" + matches + ${content} + ) + foreach(match ${matches}) + string( + REGEX REPLACE + "ACTS_DOES_NOT_COMPILE_BEGIN\\(([A-Za-z0-9]+)\\)" + "\\1" + match + ${match} + ) + + set(test "ActsNonCompileTest${name}${match}") + set(target "${test}_Executable") + add_executable(${target} ${_processed_source}) + target_link_libraries(${target} PUBLIC ActsCore ActsTestsCommonHelpers) + target_compile_definitions(${target} PRIVATE "-D${match}") + add_dependencies(${target} "${name}_generated_source") + + set_target_properties( + ${target} + PROPERTIES EXCLUDE_FROM_ALL ON EXCLUDE_FROM_DEFAULT_BUILD ON + ) + + add_test( + NAME ${test} + COMMAND + ${CMAKE_COMMAND} --build . --target ${target} --config + $ + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + set_tests_properties(${test} PROPERTIES WILL_FAIL ON) + endforeach() endfunction() add_subdirectory(Core) diff --git a/Tests/UnitTests/Core/MagneticField/CMakeLists.txt b/Tests/UnitTests/Core/MagneticField/CMakeLists.txt index f207d5d6228..60a829bf548 100644 --- a/Tests/UnitTests/Core/MagneticField/CMakeLists.txt +++ b/Tests/UnitTests/Core/MagneticField/CMakeLists.txt @@ -1,5 +1,4 @@ add_unittest(ConstantBField ConstantBFieldTests.cpp) add_unittest(InterpolatedBFieldMap InterpolatedBFieldMapTests.cpp) -#add_unittest(MagneticFieldInterfaceConsistency MagneticFieldInterfaceConsistencyTests.cpp) add_unittest(SolenoidBField SolenoidBFieldTests.cpp) add_unittest(MagneticFieldProvider MagneticFieldProviderTests.cpp) diff --git a/Tests/UnitTests/Core/MagneticField/MagneticFieldInterfaceConsistencyTests.cpp b/Tests/UnitTests/Core/MagneticField/MagneticFieldInterfaceConsistencyTests.cpp deleted file mode 100644 index f6d2a153c5b..00000000000 --- a/Tests/UnitTests/Core/MagneticField/MagneticFieldInterfaceConsistencyTests.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include - -#include "Acts/Definitions/Algebra.hpp" -#include "Acts/Definitions/Units.hpp" -#include "Acts/MagneticField/ConstantBField.hpp" -#include "Acts/MagneticField/InterpolatedBFieldMap.hpp" -#include "Acts/MagneticField/MagneticFieldContext.hpp" -#include "Acts/MagneticField/MagneticFieldProvider.hpp" -#include "Acts/MagneticField/SolenoidBField.hpp" - -namespace Acts::Test { - -// Create a test context -MagneticFieldContext mfContext = MagneticFieldContext(); - -/// This is the canonical interface that all field implementations -/// need to comply with. -/// This test group is should include ALL field implementations, -/// to make sure they conform to the interface, even if they are -/// not implicitly tested by some of the other tests (e.g. Propagation) -/// The function does not assert any functionality, it just ensures -/// the interface compiles -template -void testInterfaceConsistency(const BField_t& field) { - using Cache_t = typename BField_t::Cache; - Vector3 pos(0, 0, 0); - Vector3 B; - ActsMatrix<3, 3> gradient; - - // test interface method without cache - field.getField(pos); - field.getFieldGradient(pos, gradient); - - // test interface method with cache - Cache_t cache(mfContext); - field.getField(pos, cache); - field.getFieldGradient(pos, gradient, cache); -} - -BOOST_AUTO_TEST_CASE(TestConstantBFieldInterfaceConsistency) { - ConstantBField field(1, 1, 1); - testInterfaceConsistency(field); -} - -BOOST_AUTO_TEST_CASE(TestSolenoidBFieldInterfaceConsistency) { - SolenoidBField field({100, 1000, 20, 5}); - testInterfaceConsistency(field); -} - -BOOST_AUTO_TEST_CASE(TestInterpolatedBFieldMapInterfaceConsistency) { - // define dummy mapper and field cell, we don't need them to do anything - struct DummyFieldCell { - Vector3 getField(const Vector3&) const { return {0, 0, 0}; } - bool isInside(const Vector3&) const { return true; } - }; - - struct DummyMapper : DummyFieldCell { - using FieldCell = DummyFieldCell; - - DummyFieldCell getFieldCell(const Vector3&) const { - return DummyFieldCell(); - } - std::vector getNBins() const { return {42}; } - std::vector getMin() const { return {5}; } - std::vector getMax() const { return {15}; } - }; - - DummyMapper m; - InterpolatedBFieldMap::Config config(std::move(m)); - config.scale = 1.; - - // create BField service - InterpolatedBFieldMap b(std::move(config)); - - testInterfaceConsistency(b); -} - -} // namespace Acts::Test diff --git a/Tests/UnitTests/Core/Utilities/CMakeLists.txt b/Tests/UnitTests/Core/Utilities/CMakeLists.txt index af362d6d564..30bfda33fc3 100644 --- a/Tests/UnitTests/Core/Utilities/CMakeLists.txt +++ b/Tests/UnitTests/Core/Utilities/CMakeLists.txt @@ -39,14 +39,20 @@ add_unittest(TypeTraits TypeTraitsTest.cpp) add_unittest(UnitVectors UnitVectorsTests.cpp) add_unittest(Delegate DelegateTests.cpp) add_unittest(HashedString HashedStringTests.cpp) -if (ACTS_BUILD_CUDA_FEATURES) - add_unittest(Cuda CudaTests.cu) - add_unittest(CudaMostSimplified CudaMostSimplifiedTests.cu) +if(ACTS_BUILD_CUDA_FEATURES) + add_unittest(Cuda CudaTests.cu) + add_unittest(CudaMostSimplified CudaMostSimplifiedTests.cu) endif() add_unittest(Any AnyTests.cpp) add_unittest(AnyDebug AnyTests.cpp) -target_compile_definitions(ActsUnitTestAnyDebug PRIVATE _ACTS_ANY_ENABLE_VERBOSE _ACTS_ANY_ENABLE_DEBUG _ACTS_ANY_ENABLE_TRACK_ALLOCATIONS) +target_compile_definitions( + ActsUnitTestAnyDebug + PRIVATE + _ACTS_ANY_ENABLE_VERBOSE + _ACTS_ANY_ENABLE_DEBUG + _ACTS_ANY_ENABLE_TRACK_ALLOCATIONS +) add_unittest(ParticleData ParticleDataTests.cpp) add_unittest(Zip ZipTests.cpp) diff --git a/Tests/UnitTests/Plugins/Cuda/Seeding/CMakeLists.txt b/Tests/UnitTests/Plugins/Cuda/Seeding/CMakeLists.txt index 8cc71759a99..20148fcae23 100644 --- a/Tests/UnitTests/Plugins/Cuda/Seeding/CMakeLists.txt +++ b/Tests/UnitTests/Plugins/Cuda/Seeding/CMakeLists.txt @@ -1,2 +1,5 @@ add_executable(ActsUnitTestSeedFinderCuda SeedFinderCudaTest.cpp) -target_link_libraries(ActsUnitTestSeedFinderCuda PRIVATE ${unittest_extra_libraries} Boost::boost) +target_link_libraries( + ActsUnitTestSeedFinderCuda + PRIVATE ${unittest_extra_libraries} Boost::boost +) diff --git a/Tests/UnitTests/Plugins/Cuda/Seeding2/CMakeLists.txt b/Tests/UnitTests/Plugins/Cuda/Seeding2/CMakeLists.txt index 6cecfc515e4..94709ec6bf3 100644 --- a/Tests/UnitTests/Plugins/Cuda/Seeding2/CMakeLists.txt +++ b/Tests/UnitTests/Plugins/Cuda/Seeding2/CMakeLists.txt @@ -1,12 +1,22 @@ - -add_executable(ActsUnitTestSeedFinderCuda2 - main.cpp - CommandLineArguments.hpp CommandLineArguments.cpp - ReadSeedFile.hpp ReadSeedFile.cpp - TestSpacePoint.hpp TestSpacePoint.cpp - TestDeviceCuts.hpp TestDeviceCuts.cu - TestHostCuts.hpp TestHostCuts.cpp) -target_link_libraries(ActsUnitTestSeedFinderCuda2 - PRIVATE Boost::program_options ActsCore ActsPluginCuda2) -set_target_properties(ActsUnitTestSeedFinderCuda2 - PROPERTIES CUDA_SEPARABLE_COMPILATION ON) +add_executable( + ActsUnitTestSeedFinderCuda2 + main.cpp + CommandLineArguments.hpp + CommandLineArguments.cpp + ReadSeedFile.hpp + ReadSeedFile.cpp + TestSpacePoint.hpp + TestSpacePoint.cpp + TestDeviceCuts.hpp + TestDeviceCuts.cu + TestHostCuts.hpp + TestHostCuts.cpp +) +target_link_libraries( + ActsUnitTestSeedFinderCuda2 + PRIVATE Boost::program_options ActsCore ActsPluginCuda2 +) +set_target_properties( + ActsUnitTestSeedFinderCuda2 + PROPERTIES CUDA_SEPARABLE_COMPILATION ON +) diff --git a/Tests/UnitTests/Plugins/DD4hep/CMakeLists.txt b/Tests/UnitTests/Plugins/DD4hep/CMakeLists.txt index 0dfe2a66901..912aab59887 100644 --- a/Tests/UnitTests/Plugins/DD4hep/CMakeLists.txt +++ b/Tests/UnitTests/Plugins/DD4hep/CMakeLists.txt @@ -1,46 +1,74 @@ add_library( - ActsTestsDD4hepFactories SHARED + ActsTestsDD4hepFactories + SHARED DD4hepTestsHelper.cpp LayerFactory.cpp - PrimitivesFactory.cpp) + PrimitivesFactory.cpp +) target_include_directories( ActsTestsDD4hepFactories - PUBLIC $) + PUBLIC $ +) target_link_libraries( - ActsTestsDD4hepFactories PUBLIC ActsPluginDD4hep DD4hep::DDCore) + ActsTestsDD4hepFactories + PUBLIC ActsPluginDD4hep DD4hep::DDCore +) # Not sure why this needs to be set, but dd4hep fails to compile otherwise set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) -set_target_properties(ActsTestsDD4hepFactories PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +set_target_properties( + ActsTestsDD4hepFactories + PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) dd4hep_set_version(ActsTestsDD4hepFactories MAJOR 1 MINOR 0 PATCH 0) dd4hep_generate_rootmap(ActsTestsDD4hepFactories) find_library(dd4hep_core_library DDCore) if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24.0") - set(factory_path "$>") + set(factory_path + "$>" + ) else() - set(factory_path "${CMAKE_CURRENT_BINARY_DIR}") + set(factory_path "${CMAKE_CURRENT_BINARY_DIR}") endif() - -if (NOT "${dd4hep_core_library}" STREQUAL "dd4hep_core_library-NOTFOUND") - cmake_path(GET dd4hep_core_library PARENT_PATH DD4HEP_LIBRARY_PATH) - # set test library dependencies - set(unittest_extra_libraries ActsTestsDD4hepFactories ActsPluginDD4hep) - set(dd4hep_tests DD4hepDetectorElement DD4hepCylinderLayerStructure DD4hepDiscLayerStructure DD4hepCylindricalDetector) - foreach(_test ${dd4hep_tests}) - add_unittest(${_test} ${_test}Tests.cpp) - add_dependencies(ActsUnitTest${_test} Components_ActsTestsDD4hepFactories) - if(APPLE) - set_property(TEST ${_test} PROPERTY ENVIRONMENT - "DYLD_LIBRARY_PATH=${DD4HEP_LIBRARY_PATH}:${factory_path}:$ENV{DYLD_LIBRARY_PATH}") - else() - set_property(TEST ${_test} PROPERTY ENVIRONMENT - "LD_LIBRARY_PATH=${DD4HEP_LIBRARY_PATH}:${factory_path}:$ENV{LD_LIBRARY_PATH}") - endif() - endforeach() +if(NOT "${dd4hep_core_library}" STREQUAL "dd4hep_core_library-NOTFOUND") + cmake_path(GET dd4hep_core_library PARENT_PATH DD4HEP_LIBRARY_PATH) + # set test library dependencies + set(unittest_extra_libraries ActsTestsDD4hepFactories ActsPluginDD4hep) + set(dd4hep_tests + DD4hepDetectorElement + DD4hepCylinderLayerStructure + DD4hepDiscLayerStructure + DD4hepCylindricalDetector + ) + foreach(_test ${dd4hep_tests}) + add_unittest(${_test} ${_test}Tests.cpp) + add_dependencies( + ActsUnitTest${_test} + Components_ActsTestsDD4hepFactories + ) + if(APPLE) + set_property( + TEST ${_test} + PROPERTY + ENVIRONMENT + "DYLD_LIBRARY_PATH=${DD4HEP_LIBRARY_PATH}:${factory_path}:$ENV{DYLD_LIBRARY_PATH}" + ) + else() + set_property( + TEST ${_test} + PROPERTY + ENVIRONMENT + "LD_LIBRARY_PATH=${DD4HEP_LIBRARY_PATH}:${factory_path}:$ENV{LD_LIBRARY_PATH}" + ) + endif() + endforeach() else() - message(WARNING "DD4hep libraries not found, DD4hep tests will not be built.") + message( + WARNING + "DD4hep libraries not found, DD4hep tests will not be built." + ) endif() diff --git a/Tests/UnitTests/Plugins/FpeMonitoring/CMakeLists.txt b/Tests/UnitTests/Plugins/FpeMonitoring/CMakeLists.txt index bef6d56adfb..9c0957c49f7 100644 --- a/Tests/UnitTests/Plugins/FpeMonitoring/CMakeLists.txt +++ b/Tests/UnitTests/Plugins/FpeMonitoring/CMakeLists.txt @@ -1,7 +1,10 @@ set(unittest_extra_libraries ActsPluginFpeMonitoring) if(NOT APPLE) - # This test doesn't make sense on macOS at this time - add_unittest(FpeMonitor FpeMonitorTests.cpp) - set_tests_properties(FpeMonitor PROPERTIES ENVIRONMENT BOOST_TEST_CATCH_SYSTEM_ERRORS=no) + # This test doesn't make sense on macOS at this time + add_unittest(FpeMonitor FpeMonitorTests.cpp) + set_tests_properties( + FpeMonitor + PROPERTIES ENVIRONMENT BOOST_TEST_CATCH_SYSTEM_ERRORS=no + ) endif() diff --git a/Tests/UnitTests/Plugins/TGeo/CMakeLists.txt b/Tests/UnitTests/Plugins/TGeo/CMakeLists.txt index dff88398c8a..5592d6b4849 100644 --- a/Tests/UnitTests/Plugins/TGeo/CMakeLists.txt +++ b/Tests/UnitTests/Plugins/TGeo/CMakeLists.txt @@ -6,7 +6,7 @@ add_unittest(TGeoTrd1Conversion TGeoTrd1ConversionTests.cpp) add_unittest(TGeoTrd2Conversion TGeoTrd2ConversionTests.cpp) add_unittest(TGeoTubeConversion TGeoTubeConversionTests.cpp) add_unittest(TGeoLayerBuilder TGeoLayerBuilderTests.cpp) -if (${ROOT_VERSION} VERSION_GREATER "6.25.01") +if(${ROOT_VERSION} VERSION_GREATER "6.25.01") add_unittest(TGeoMaterialConverter TGeoMaterialConverterTests.cpp) endif() add_unittest(TGeoParser TGeoParserTests.cpp) diff --git a/cmake/ActsCompilerOptions.cmake b/cmake/ActsCompilerOptions.cmake index ea1b505c3d5..5646f972a65 100644 --- a/cmake/ActsCompilerOptions.cmake +++ b/cmake/ActsCompilerOptions.cmake @@ -1,7 +1,12 @@ # Acts compiler flags -if (NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Build type configuration" FORCE) - message(STATUS "Setting default build type: ${CMAKE_BUILD_TYPE}") +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE + RelWithDebInfo + CACHE STRING + "Build type configuration" + FORCE + ) + message(STATUS "Setting default build type: ${CMAKE_BUILD_TYPE}") endif() set(cxx_flags "-Wall -Wextra -Wpedantic -Wshadow -Wno-unused-local-typedefs") @@ -10,25 +15,26 @@ set(cxx_flags "-Wall -Wextra -Wpedantic -Wshadow -Wno-unused-local-typedefs") # However, at the moment this is only added to clang builds, since GCC's -Wfloat-conversion # is much more aggressive and also triggers on e.g., double-to-float if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(cxx_flags "${cxx_flags} -Wfloat-conversion") + set(cxx_flags "${cxx_flags} -Wfloat-conversion") endif() - set(ACTS_CXX_STANDARD 20) set(ACTS_CXX_STANDARD_FEATURE cxx_std_20) if(DEFINED CMAKE_CXX_STANDARD) - if(${CMAKE_CXX_STANDARD} GREATER_EQUAL 20) - set(ACTS_CXX_STANDARD ${CMAKE_CXX_STANDARD}) - set(ACTS_CXX_STANDARD_FEATURE "cxx_std_${CMAKE_CXX_STANDARD}") - else() - message(SEND_ERROR "CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}, but ACTS requires C++ >=20") - endif() + if(${CMAKE_CXX_STANDARD} GREATER_EQUAL 20) + set(ACTS_CXX_STANDARD ${CMAKE_CXX_STANDARD}) + set(ACTS_CXX_STANDARD_FEATURE "cxx_std_${CMAKE_CXX_STANDARD}") + else() + message( + SEND_ERROR + "CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}, but ACTS requires C++ >=20" + ) + endif() endif() - if(ACTS_ENABLE_CPU_PROFILING OR ACTS_ENABLE_MEMORY_PROFILING) - message(STATUS "Added debug symbol compile flag") - set(cxx_flags "${cxx_flags} ${CMAKE_CXX_FLAGS_DEBUG_INIT}") + message(STATUS "Added debug symbol compile flag") + set(cxx_flags "${cxx_flags} ${CMAKE_CXX_FLAGS_DEBUG_INIT}") endif() # assign to global CXX flags diff --git a/cmake/ActsComponentsHelpers.cmake b/cmake/ActsComponentsHelpers.cmake index 80e421ffe93..e0720e08595 100644 --- a/cmake/ActsComponentsHelpers.cmake +++ b/cmake/ActsComponentsHelpers.cmake @@ -29,16 +29,21 @@ set(_components) # add an optional directory and register its name as a component function(add_component_if path name) - file(RELATIVE_PATH _rel ${PROJECT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/${path}") - if(${ARGN}) - list(APPEND _components "${name}") - # propagate variable outside function scope - set(_components "${_components}" PARENT_SCOPE) - message(STATUS "Enable component '${name}' in '${_rel}'") - add_subdirectory(${path}) - else() - message(STATUS "Ignore component '${name}' in '${_rel}'") - endif() + file( + RELATIVE_PATH + _rel + ${PROJECT_SOURCE_DIR} + "${CMAKE_CURRENT_SOURCE_DIR}/${path}" + ) + if(${ARGN}) + list(APPEND _components "${name}") + # propagate variable outside function scope + set(_components "${_components}" PARENT_SCOPE) + message(STATUS "Enable component '${name}' in '${_rel}'") + add_subdirectory(${path}) + else() + message(STATUS "Ignore component '${name}' in '${_rel}'") + endif() endfunction() # add a directory and register its name as a component @@ -48,16 +53,21 @@ endmacro() # propagate the list of components to the parent scope macro(propagate_components_to_parent) - set(_components "${_components}" PARENT_SCOPE) + set(_components "${_components}" PARENT_SCOPE) endmacro() # add an optional subdirectory that is **not** registered as a component function(add_subdirectory_if path) - file(RELATIVE_PATH _rel ${PROJECT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/${path}") - if(${ARGN}) - message(STATUS "Enable subdirectory '${_rel}'") - add_subdirectory(${path}) - else() - message(STATUS "Ignore subdirectory '${_rel}'") - endif() + file( + RELATIVE_PATH + _rel + ${PROJECT_SOURCE_DIR} + "${CMAKE_CURRENT_SOURCE_DIR}/${path}" + ) + if(${ARGN}) + message(STATUS "Enable subdirectory '${_rel}'") + add_subdirectory(${path}) + else() + message(STATUS "Ignore subdirectory '${_rel}'") + endif() endfunction() diff --git a/cmake/ActsCreatePackageConfig.cmake b/cmake/ActsCreatePackageConfig.cmake index dd73597d2ff..f2aa6d0edfb 100644 --- a/cmake/ActsCreatePackageConfig.cmake +++ b/cmake/ActsCreatePackageConfig.cmake @@ -8,30 +8,34 @@ set(install_package_config_dir "${CMAKE_INSTALL_LIBDIR}/cmake/Acts") # version is taken automatically from PROJECT_VERSION; no need to specify write_basic_package_version_file( - ${PROJECT_BINARY_DIR}/ActsConfigVersion.cmake - COMPATIBILITY SameMajorVersion) + ${PROJECT_BINARY_DIR}/ActsConfigVersion.cmake + COMPATIBILITY SameMajorVersion +) configure_package_config_file( - ${CMAKE_CURRENT_LIST_DIR}/ActsConfig.cmake.in - ${PROJECT_BINARY_DIR}/ActsConfig.cmake - INSTALL_DESTINATION ${install_package_config_dir} - PATH_VARS CMAKE_INSTALL_BINDIR CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR) + ${CMAKE_CURRENT_LIST_DIR}/ActsConfig.cmake.in + ${PROJECT_BINARY_DIR}/ActsConfig.cmake + INSTALL_DESTINATION ${install_package_config_dir} + PATH_VARS CMAKE_INSTALL_BINDIR CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR +) # install cmake package configs install( - FILES - ${PROJECT_BINARY_DIR}/ActsConfigVersion.cmake - ${PROJECT_BINARY_DIR}/ActsConfig.cmake - DESTINATION ${install_package_config_dir}) + FILES + ${PROJECT_BINARY_DIR}/ActsConfigVersion.cmake + ${PROJECT_BINARY_DIR}/ActsConfig.cmake + DESTINATION ${install_package_config_dir} +) # install third party FindXXX.cmake files install( - FILES - ${CMAKE_CURRENT_LIST_DIR}/FindOnnxRuntime.cmake - DESTINATION ${install_package_config_dir}/Modules) + FILES ${CMAKE_CURRENT_LIST_DIR}/FindOnnxRuntime.cmake + DESTINATION ${install_package_config_dir}/Modules +) # install target configs for all available components foreach(_component ${_components}) - install( - EXPORT Acts${_component}Targets - DESTINATION ${install_package_config_dir}) + install( + EXPORT Acts${_component}Targets + DESTINATION ${install_package_config_dir} + ) endforeach() diff --git a/cmake/ActsCreateSetup.cmake b/cmake/ActsCreateSetup.cmake index ef37ea1db3b..bc69a2babed 100644 --- a/cmake/ActsCreateSetup.cmake +++ b/cmake/ActsCreateSetup.cmake @@ -1,16 +1,20 @@ # Create a setup.sh file at the install prefix to setup the shell environment configure_file( - ${CMAKE_CURRENT_LIST_DIR}/setup.sh.in - ${PROJECT_BINARY_DIR}/this_acts.sh - @ONLY) + ${CMAKE_CURRENT_LIST_DIR}/setup.sh.in + ${PROJECT_BINARY_DIR}/this_acts.sh + @ONLY +) install( - FILES ${PROJECT_BINARY_DIR}/this_acts.sh - DESTINATION ${CMAKE_INSTALL_BINDIR}) + FILES ${PROJECT_BINARY_DIR}/this_acts.sh + DESTINATION ${CMAKE_INSTALL_BINDIR} +) configure_file( - ${CMAKE_CURRENT_LIST_DIR}/setup_withdeps.sh.in - ${PROJECT_BINARY_DIR}/this_acts_withdeps.sh - @ONLY) + ${CMAKE_CURRENT_LIST_DIR}/setup_withdeps.sh.in + ${PROJECT_BINARY_DIR}/this_acts_withdeps.sh + @ONLY +) install( - FILES ${PROJECT_BINARY_DIR}/this_acts_withdeps.sh - DESTINATION ${CMAKE_INSTALL_BINDIR}) + FILES ${PROJECT_BINARY_DIR}/this_acts_withdeps.sh + DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/cmake/ActsExternSources.cmake b/cmake/ActsExternSources.cmake index 70920a42663..f2e2ea146b5 100644 --- a/cmake/ActsExternSources.cmake +++ b/cmake/ActsExternSources.cmake @@ -1,39 +1,69 @@ -set( ACTS_ACTSVG_SOURCE - "URL;https://github.com/acts-project/actsvg/archive/refs/tags/v0.4.47.tar.gz;URL_HASH;SHA256=aeb3927f8db1c7c9b8afa76adaa720013aa03a01032c8d5f457f623e2b04a172" CACHE STRING "Source to take ACTSVG from") -mark_as_advanced( ACTS_ACTSVG_SOURCE ) +set(ACTS_ACTSVG_SOURCE + "URL;https://github.com/acts-project/actsvg/archive/refs/tags/v0.4.47.tar.gz;URL_HASH;SHA256=aeb3927f8db1c7c9b8afa76adaa720013aa03a01032c8d5f457f623e2b04a172" + CACHE STRING + "Source to take ACTSVG from" +) +mark_as_advanced(ACTS_ACTSVG_SOURCE) -set( ACTS_VECMEM_SOURCE - "URL;https://github.com/acts-project/vecmem/archive/refs/tags/v1.4.0.tar.gz;URL_HASH;SHA256=545dfb4de4f9f3d773eef6a0e3297ebf981bb81950930d0991ad739e31ab16af" CACHE STRING "Source to take VECMEM from") -mark_as_advanced( ACTS_VECMEM_SOURCE ) +set(ACTS_VECMEM_SOURCE + "URL;https://github.com/acts-project/vecmem/archive/refs/tags/v1.4.0.tar.gz;URL_HASH;SHA256=545dfb4de4f9f3d773eef6a0e3297ebf981bb81950930d0991ad739e31ab16af" + CACHE STRING + "Source to take VECMEM from" +) +mark_as_advanced(ACTS_VECMEM_SOURCE) -set( ACTS_ALGEBRAPLUGINS_SOURCE - "URL;https://github.com/acts-project/algebra-plugins/archive/refs/tags/v0.22.0.tar.gz;URL_HASH;SHA256=6fde02181c1b856c0a17a1925f0969798eecd5e3d6f2a87ea2eb365b6c948cc1" CACHE STRING "Source to take ALGEBRAPLUGINS from") -mark_as_advanced( ACTS_ALGEBRAPLUGINS_SOURCE ) +set(ACTS_ALGEBRAPLUGINS_SOURCE + "URL;https://github.com/acts-project/algebra-plugins/archive/refs/tags/v0.22.0.tar.gz;URL_HASH;SHA256=6fde02181c1b856c0a17a1925f0969798eecd5e3d6f2a87ea2eb365b6c948cc1" + CACHE STRING + "Source to take ALGEBRAPLUGINS from" +) +mark_as_advanced(ACTS_ALGEBRAPLUGINS_SOURCE) -set( ACTS_COVFIE_SOURCE - "URL;https://github.com/acts-project/covfie/archive/refs/tags/v0.10.0.tar.gz;URL_HASH;SHA256=d44142b302ffc193ad2229f1d2cc6d8d720dd9da8c37989ada4f23018f86c964" CACHE STRING "Source to take COVFIE from") -mark_as_advanced( ACTS_COVFIE_SOURCE ) +set(ACTS_COVFIE_SOURCE + "URL;https://github.com/acts-project/covfie/archive/refs/tags/v0.10.0.tar.gz;URL_HASH;SHA256=d44142b302ffc193ad2229f1d2cc6d8d720dd9da8c37989ada4f23018f86c964" + CACHE STRING + "Source to take COVFIE from" +) +mark_as_advanced(ACTS_COVFIE_SOURCE) -set( ACTS_DETRAY_SOURCE - "URL;https://github.com/acts-project/detray/archive/refs/tags/v0.72.1.tar.gz;URL_HASH;SHA256=6cc8d34bc0d801338e9ab142c4a9884d19d9c02555dbb56972fab86b98d0f75b" CACHE STRING "Source to take DETRAY from") -mark_as_advanced( ACTS_DETRAY_SOURCE ) +set(ACTS_DETRAY_SOURCE + "URL;https://github.com/acts-project/detray/archive/refs/tags/v0.72.1.tar.gz;URL_HASH;SHA256=6cc8d34bc0d801338e9ab142c4a9884d19d9c02555dbb56972fab86b98d0f75b" + CACHE STRING + "Source to take DETRAY from" +) +mark_as_advanced(ACTS_DETRAY_SOURCE) -set( ACTS_TRACCC_SOURCE - "URL;https://github.com/acts-project/traccc/archive/refs/tags/v0.15.0.tar.gz;URL_HASH;SHA256=1a9a1d0d2f6c4a7773eae3119b1e044fb52031ca49dfc88e6dc4ab8a11df167e" CACHE STRING "Source to take TRACCC from") -mark_as_advanced( ACTS_TRACCC_SOURCE ) +set(ACTS_TRACCC_SOURCE + "URL;https://github.com/acts-project/traccc/archive/refs/tags/v0.15.0.tar.gz;URL_HASH;SHA256=1a9a1d0d2f6c4a7773eae3119b1e044fb52031ca49dfc88e6dc4ab8a11df167e" + CACHE STRING + "Source to take TRACCC from" +) +mark_as_advanced(ACTS_TRACCC_SOURCE) -set( ACTS_FRNN_SOURCE - "GIT_REPOSITORY;https://github.com/hrzhao76/FRNN/;GIT_TAG;5f8a48b0022300cd2863119f5646a5f31373e0c8" CACHE STRING "Source to take FRNN from") -mark_as_advanced( ACTS_FRNN_SOURCE ) +set(ACTS_FRNN_SOURCE + "GIT_REPOSITORY;https://github.com/hrzhao76/FRNN/;GIT_TAG;5f8a48b0022300cd2863119f5646a5f31373e0c8" + CACHE STRING + "Source to take FRNN from" +) +mark_as_advanced(ACTS_FRNN_SOURCE) -set( ACTS_NLOHMANNJSON_SOURCE - "URL;https://github.com/nlohmann/json/archive/refs/tags/v3.10.5.tar.gz;URL_HASH;SHA256=5daca6ca216495edf89d167f808d1d03c4a4d929cef7da5e10f135ae1540c7e4" CACHE STRING "Source to take nlohmann_json from") -mark_as_advanced( ACTS_NLOHMANN_JSON_SOURCE ) +set(ACTS_NLOHMANNJSON_SOURCE + "URL;https://github.com/nlohmann/json/archive/refs/tags/v3.10.5.tar.gz;URL_HASH;SHA256=5daca6ca216495edf89d167f808d1d03c4a4d929cef7da5e10f135ae1540c7e4" + CACHE STRING + "Source to take nlohmann_json from" +) +mark_as_advanced(ACTS_NLOHMANN_JSON_SOURCE) -set( ACTS_EIGEN3_SOURCE - "URL;https://gitlab.com/libeigen/eigen/-/archive/${_acts_eigen3_version}/${_acts_eigen3_version}.tar.gz;URL_HASH;SHA256=ba6ef66ba2d319e0a871a267889411c550d4bdf5bc7c62f86c60276913f3f4ba" CACHE STRING "Source to take eigen3 from") -mark_as_advanced( ACTS_EIGEN3_SOURCE ) +set(ACTS_EIGEN3_SOURCE + "URL;https://gitlab.com/libeigen/eigen/-/archive/${_acts_eigen3_version}/${_acts_eigen3_version}.tar.gz;URL_HASH;SHA256=ba6ef66ba2d319e0a871a267889411c550d4bdf5bc7c62f86c60276913f3f4ba" + CACHE STRING + "Source to take eigen3 from" +) +mark_as_advanced(ACTS_EIGEN3_SOURCE) -set( ACTS_PYBIND11_SOURCE - "GIT_REPOSITORY;https://github.com/pybind/pybind11.git;GIT_TAG;v2.13.1" CACHE STRING "Source to take pybind11 from") -mark_as_advanced( ACTS_PYBIND11_SOURCE ) +set(ACTS_PYBIND11_SOURCE + "GIT_REPOSITORY;https://github.com/pybind/pybind11.git;GIT_TAG;v2.13.1" + CACHE STRING + "Source to take pybind11 from" +) +mark_as_advanced(ACTS_PYBIND11_SOURCE) diff --git a/cmake/ActsGenerateNonCompileTest.cmake b/cmake/ActsGenerateNonCompileTest.cmake index 3ec2f3ee07c..a1561d03af7 100644 --- a/cmake/ActsGenerateNonCompileTest.cmake +++ b/cmake/ActsGenerateNonCompileTest.cmake @@ -2,8 +2,13 @@ file(READ ${INPUT_FILE} content) -string(REGEX REPLACE "ACTS_DOES_NOT_COMPILE_BEGIN\\(([A-Za-z0-9]+)\\)" "#if defined(\\1)" processed "${content}") +string( + REGEX REPLACE + "ACTS_DOES_NOT_COMPILE_BEGIN\\(([A-Za-z0-9]+)\\)" + "#if defined(\\1)" + processed + "${content}" +) string(REPLACE "ACTS_DOES_NOT_COMPILE_END()" "#endif" processed "${processed}") - file(WRITE ${OUTPUT_FILE} "${processed}") diff --git a/cmake/ActsOptionHelpers.cmake b/cmake/ActsOptionHelpers.cmake index c3f5b7c5f00..a1b6d283e66 100644 --- a/cmake/ActsOptionHelpers.cmake +++ b/cmake/ActsOptionHelpers.cmake @@ -12,10 +12,10 @@ # macro(set_option_if option) - if(${ARGN}) - # create a regular (directory-scope) variable that should take precedence - # over a cache entry of the same name. that means that automatically - # activated options are not stored in the cache. - set(${option} ON) - endif() + if(${ARGN}) + # create a regular (directory-scope) variable that should take precedence + # over a cache entry of the same name. that means that automatically + # activated options are not stored in the cache. + set(${option} ON) + endif() endmacro() diff --git a/cmake/ActsRetrieveVersion.cmake b/cmake/ActsRetrieveVersion.cmake index 95d575f9e04..a21c34aad51 100644 --- a/cmake/ActsRetrieveVersion.cmake +++ b/cmake/ActsRetrieveVersion.cmake @@ -16,11 +16,11 @@ get_git_head_revision(_git_refspec _git_hash) string(SUBSTRING "${_git_hash}" 0 9 _git_hash_short) git_local_changes(_git_local_changes) if(_git_local_changes STREQUAL "CLEAN") - set(_acts_commit_hash "${_git_hash}") - set(_acts_commit_hash_short "${_git_hash_short}") + set(_acts_commit_hash "${_git_hash}") + set(_acts_commit_hash_short "${_git_hash_short}") else() - set(_acts_commit_hash "${_git_hash}-dirty") - set(_acts_commit_hash_short "${_git_hash_short}-dirty") + set(_acts_commit_hash "${_git_hash}-dirty") + set(_acts_commit_hash_short "${_git_hash_short}-dirty") endif() # remove temporary variables diff --git a/cmake/ActsStaticAnalysis.cmake b/cmake/ActsStaticAnalysis.cmake index 5b1541035ff..1e563a1846b 100644 --- a/cmake/ActsStaticAnalysis.cmake +++ b/cmake/ActsStaticAnalysis.cmake @@ -1,50 +1,55 @@ if(ACTS_RUN_CLANG_TIDY) - find_program(CLANG_TIDY_COMMAND NAMES clang-tidy) - if(NOT CLANG_TIDY_COMMAND) - message(WARNING "ACTS_RUN_CLANG_TIDY is ON but clang-tidy is not found!") - set(CMAKE_CXX_CLANG_TIDY "" CACHE STRING "" FORCE) - else() - message(STATUS "Setting up clang-tidy run") + find_program(CLANG_TIDY_COMMAND NAMES clang-tidy) + if(NOT CLANG_TIDY_COMMAND) + message( + WARNING + "ACTS_RUN_CLANG_TIDY is ON but clang-tidy is not found!" + ) + set(CMAKE_CXX_CLANG_TIDY "" CACHE STRING "" FORCE) + else() + message(STATUS "Setting up clang-tidy run") - set(_chks "") - list(APPEND _chks "-*") - list(APPEND _chks "clang-analyzer-optin.cplusplus.UninitializedObject") - list(APPEND _chks "cppcoreguidelines-init-variables") - list(APPEND _chks "cppcoreguidelines-pro-type-member-init") - list(APPEND _chks "google-readability-casting") - list(APPEND _chks "modernize-concat-nested-namespaces") - list(APPEND _chks "modernize-use-equals-default") - list(APPEND _chks "modernize-use-default-member-init") - list(APPEND _chks "modernize-use-nullptr") - list(APPEND _chks "modernize-use-override") - list(APPEND _chks "modernize-use-using") - list(APPEND _chks "performance-for-range-copy") - list(APPEND _chks "performance-move-const-arg") - list(APPEND _chks "performance-unnecessary-value-param") - list(APPEND _chks "readability-braces-around-statements") - list(APPEND _chks "readability-container-size-empty") - list(APPEND _chks "readability-implicit-bool-cast") - list(APPEND _chks "readability-implicit-bool-conversion") - list(APPEND _chks "readability-inconsistent-declaration-parameter-name") - list(APPEND _chks "readability-named-parameter") - list(APPEND _chks "readability-operators-representation") - list(JOIN _chks "," CLANG_TIDY_CHECKS) + set(_chks "") + list(APPEND _chks "-*") + list(APPEND _chks "clang-analyzer-optin.cplusplus.UninitializedObject") + list(APPEND _chks "cppcoreguidelines-init-variables") + list(APPEND _chks "cppcoreguidelines-pro-type-member-init") + list(APPEND _chks "google-readability-casting") + list(APPEND _chks "modernize-concat-nested-namespaces") + list(APPEND _chks "modernize-use-equals-default") + list(APPEND _chks "modernize-use-default-member-init") + list(APPEND _chks "modernize-use-nullptr") + list(APPEND _chks "modernize-use-override") + list(APPEND _chks "modernize-use-using") + list(APPEND _chks "performance-for-range-copy") + list(APPEND _chks "performance-move-const-arg") + list(APPEND _chks "performance-unnecessary-value-param") + list(APPEND _chks "readability-braces-around-statements") + list(APPEND _chks "readability-container-size-empty") + list(APPEND _chks "readability-implicit-bool-cast") + list(APPEND _chks "readability-implicit-bool-conversion") + list(APPEND _chks "readability-inconsistent-declaration-parameter-name") + list(APPEND _chks "readability-named-parameter") + list(APPEND _chks "readability-operators-representation") + list(JOIN _chks "," CLANG_TIDY_CHECKS) - message(STATUS "Configured checks") - foreach(_chk ${_chks}) - message(STATUS "|-> ${_chk}") - endforeach() + message(STATUS "Configured checks") + foreach(_chk ${_chks}) + message(STATUS "|-> ${_chk}") + endforeach() - set(_errs "") - list(JOIN _errs "," CLANG_TIDY_ERRORS) + set(_errs "") + list(JOIN _errs "," CLANG_TIDY_ERRORS) - message(STATUS "Enabled errors:") - foreach(_err ${_errs}) - message(STATUS "|-> ${_err}") - endforeach() + message(STATUS "Enabled errors:") + foreach(_err ${_errs}) + message(STATUS "|-> ${_err}") + endforeach() - set(CLANG_TIDY_HEADER_FILTER ".*") + set(CLANG_TIDY_HEADER_FILTER ".*") - set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND};-checks=${CLANG_TIDY_CHECKS};-header-filter=${CLANG_TIDY_HEADER_FILTER};-warnings-as-errors=${CLANG_TIDY_ERRORS}") - endif() + set(CMAKE_CXX_CLANG_TIDY + "${CLANG_TIDY_COMMAND};-checks=${CLANG_TIDY_CHECKS};-header-filter=${CLANG_TIDY_HEADER_FILTER};-warnings-as-errors=${CLANG_TIDY_ERRORS}" + ) + endif() endif() diff --git a/cmake/ActsTargetLinkLibrariesSystem.cmake b/cmake/ActsTargetLinkLibrariesSystem.cmake index dfddd04a297..e3ad7b2c367 100644 --- a/cmake/ActsTargetLinkLibrariesSystem.cmake +++ b/cmake/ActsTargetLinkLibrariesSystem.cmake @@ -2,30 +2,45 @@ # necessary until cmake 3.25 https://cmake.org/cmake/help/latest/prop_tgt/SYSTEM.html#prop_tgt:SYSTEM function(acts_target_link_libraries_system target) - set(options PRIVATE PUBLIC INTERFACE) - cmake_parse_arguments(TLLS "${options}" "" "" ${ARGN}) - foreach(op ${options}) - if(TLLS_${op}) - set(scope ${op}) - endif() - endforeach(op) - set(libs ${TLLS_UNPARSED_ARGUMENTS}) + set(options PRIVATE PUBLIC INTERFACE) + cmake_parse_arguments(TLLS "${options}" "" "" ${ARGN}) + foreach(op ${options}) + if(TLLS_${op}) + set(scope ${op}) + endif() + endforeach(op) + set(libs ${TLLS_UNPARSED_ARGUMENTS}) - foreach(lib ${libs}) - get_target_property(lib_include_dirs ${lib} INTERFACE_INCLUDE_DIRECTORIES) - if(lib_include_dirs) - if(scope) - target_include_directories(${target} SYSTEM ${scope} ${lib_include_dirs}) - else() - target_include_directories(${target} SYSTEM PRIVATE ${lib_include_dirs}) - endif() - else() - message("Warning: ${lib} doesn't set INTERFACE_INCLUDE_DIRECTORIES. No include_directories set.") - endif() - if(scope) - target_link_libraries(${target} ${scope} ${lib}) - else() - target_link_libraries(${target} ${lib}) - endif() - endforeach() + foreach(lib ${libs}) + get_target_property( + lib_include_dirs + ${lib} + INTERFACE_INCLUDE_DIRECTORIES + ) + if(lib_include_dirs) + if(scope) + target_include_directories( + ${target} + SYSTEM + ${scope} + ${lib_include_dirs} + ) + else() + target_include_directories( + ${target} + SYSTEM + PRIVATE ${lib_include_dirs} + ) + endif() + else() + message( + "Warning: ${lib} doesn't set INTERFACE_INCLUDE_DIRECTORIES. No include_directories set." + ) + endif() + if(scope) + target_link_libraries(${target} ${scope} ${lib}) + else() + target_link_libraries(${target} ${lib}) + endif() + endforeach() endfunction(acts_target_link_libraries_system) diff --git a/cmake/FindFilesystem.cmake b/cmake/FindFilesystem.cmake index de3f25cb567..93cc9b9c8a3 100644 --- a/cmake/FindFilesystem.cmake +++ b/cmake/FindFilesystem.cmake @@ -98,13 +98,11 @@ Using `find_package(Filesystem)` with no component arguments: #]=======================================================================] - if(TARGET std::filesystem) # This module has already been processed. Don't do it again. return() endif() - include(CMakePushCheckState) include(CheckIncludeFileCXX) @@ -136,7 +134,10 @@ endif() set(extra_components ${want_components}) list(REMOVE_ITEM extra_components Final Experimental) foreach(component IN LISTS extra_components) - message(WARNING "Extraneous find_package component for Filesystem: ${component}") + message( + WARNING + "Extraneous find_package component for Filesystem: ${component}" + ) endforeach() # Detect which of Experimental and Final we should look for @@ -162,7 +163,10 @@ else() endif() if(find_experimental) - check_include_file_cxx("experimental/filesystem" _CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER) + check_include_file_cxx( + "experimental/filesystem" + _CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER + ) mark_as_advanced(_CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER) else() set(_CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER FALSE) @@ -182,16 +186,34 @@ else() set(_have_fs FALSE) endif() -set(CXX_FILESYSTEM_HAVE_FS ${_have_fs} CACHE BOOL "TRUE if we have the C++ filesystem headers") -set(CXX_FILESYSTEM_HEADER ${_fs_header} CACHE STRING "The header that should be included to obtain the filesystem APIs") -set(CXX_FILESYSTEM_NAMESPACE ${_fs_namespace} CACHE STRING "The C++ namespace that contains the filesystem APIs") -set(CXX_FILESYSTEM_IS_EXPERIMENTAL ${_is_experimental} CACHE BOOL "TRUE if the C++ filesystem library is the experimental version") +set(CXX_FILESYSTEM_HAVE_FS + ${_have_fs} + CACHE BOOL + "TRUE if we have the C++ filesystem headers" +) +set(CXX_FILESYSTEM_HEADER + ${_fs_header} + CACHE STRING + "The header that should be included to obtain the filesystem APIs" +) +set(CXX_FILESYSTEM_NAMESPACE + ${_fs_namespace} + CACHE STRING + "The C++ namespace that contains the filesystem APIs" +) +set(CXX_FILESYSTEM_IS_EXPERIMENTAL + ${_is_experimental} + CACHE BOOL + "TRUE if the C++ filesystem library is the experimental version" +) set(_found FALSE) if(CXX_FILESYSTEM_HAVE_FS) # We have some filesystem library available. Do link checks - string(CONFIGURE [[ + string( + CONFIGURE + [[ #include #include <@CXX_FILESYSTEM_HEADER@> @@ -200,7 +222,10 @@ if(CXX_FILESYSTEM_HAVE_FS) printf("%s", cwd.c_str()); return EXIT_SUCCESS; } - ]] code @ONLY) + ]] + code + @ONLY + ) # Check a simple filesystem program without any linker flags _cmcm_check_cxx_source("${code}" CXX_FILESYSTEM_NO_LINK_NEEDED) @@ -223,22 +248,39 @@ if(CXX_FILESYSTEM_HAVE_FS) if(can_link) add_library(std::filesystem INTERFACE IMPORTED) - set_property(TARGET std::filesystem APPEND PROPERTY INTERFACE_COMPILE_FEATURES cxx_std_17) + set_property( + TARGET std::filesystem + APPEND + PROPERTY INTERFACE_COMPILE_FEATURES cxx_std_17 + ) set(_found TRUE) if(CXX_FILESYSTEM_NO_LINK_NEEDED) # Nothing to add... elseif(CXX_FILESYSTEM_STDCPPFS_NEEDED) - set_property(TARGET std::filesystem APPEND PROPERTY INTERFACE_LINK_LIBRARIES -lstdc++fs) + set_property( + TARGET std::filesystem + APPEND + PROPERTY INTERFACE_LINK_LIBRARIES -lstdc++fs + ) elseif(CXX_FILESYSTEM_CPPFS_NEEDED) - set_property(TARGET std::filesystem APPEND PROPERTY INTERFACE_LINK_LIBRARIES -lc++fs) + set_property( + TARGET std::filesystem + APPEND + PROPERTY INTERFACE_LINK_LIBRARIES -lc++fs + ) endif() endif() endif() cmake_pop_check_state() -set(Filesystem_FOUND ${_found} CACHE BOOL "TRUE if we can run a program using std::filesystem" FORCE) +set(Filesystem_FOUND + ${_found} + CACHE BOOL + "TRUE if we can run a program using std::filesystem" + FORCE +) if(Filesystem_FIND_REQUIRED AND NOT Filesystem_FOUND) message(FATAL_ERROR "Cannot run simple program using std::filesystem") diff --git a/cmake/FindOnnxRuntime.cmake b/cmake/FindOnnxRuntime.cmake index ed6f3e79c40..512d0e443c0 100644 --- a/cmake/FindOnnxRuntime.cmake +++ b/cmake/FindOnnxRuntime.cmake @@ -4,49 +4,72 @@ # necessary information in its target properties. find_library( - OnnxRuntime_LIBRARY - NAMES onnxruntime - PATHS ${onnxruntime_DIR} - PATH_SUFFIXES lib lib32 lib64 - DOC "The ONNXRuntime library") + OnnxRuntime_LIBRARY + NAMES onnxruntime + PATHS ${onnxruntime_DIR} + PATH_SUFFIXES lib lib32 lib64 + DOC "The ONNXRuntime library" +) if(NOT OnnxRuntime_LIBRARY) - message(FATAL_ERROR "onnxruntime library not found") + message(FATAL_ERROR "onnxruntime library not found") else() - message(STATUS "Found OnnxRuntime library at ${OnnxRuntime_LIBRARY}") + message(STATUS "Found OnnxRuntime library at ${OnnxRuntime_LIBRARY}") endif() find_path( - OnnxRuntime_INCLUDE_DIR - NAMES onnxruntime_cxx_api.h - PATHS ${onnxruntime_DIR} - PATH_SUFFIXES include include/onnxruntime include/onnxruntime/core/session - DOC "The ONNXRuntime include directory") + OnnxRuntime_INCLUDE_DIR + NAMES onnxruntime_cxx_api.h + PATHS ${onnxruntime_DIR} + PATH_SUFFIXES include include/onnxruntime include/onnxruntime/core/session + DOC "The ONNXRuntime include directory" +) if(NOT OnnxRuntime_INCLUDE_DIR) - message(FATAL_ERROR "onnxruntime includes not found") + message(FATAL_ERROR "onnxruntime includes not found") else() - file(READ ${OnnxRuntime_INCLUDE_DIR}/onnxruntime_c_api.h ver) - string(REGEX MATCH "ORT_API_VERSION ([0-9]*)" _ ${ver}) - set(OnnxRuntime_API_VERSION ${CMAKE_MATCH_1}) - message(STATUS "Found OnnxRuntime includes at ${OnnxRuntime_INCLUDE_DIR} (API version: ${OnnxRuntime_API_VERSION})") + file(READ ${OnnxRuntime_INCLUDE_DIR}/onnxruntime_c_api.h ver) + string(REGEX MATCH "ORT_API_VERSION ([0-9]*)" _ ${ver}) + set(OnnxRuntime_API_VERSION ${CMAKE_MATCH_1}) + message( + STATUS + "Found OnnxRuntime includes at ${OnnxRuntime_INCLUDE_DIR} (API version: ${OnnxRuntime_API_VERSION})" + ) endif() - -string(REPLACE "." ";" OnnxRuntime_MIN_VERSION_LIST ${_acts_onnxruntime_version}) +string( + REPLACE + "." + ";" + OnnxRuntime_MIN_VERSION_LIST + ${_acts_onnxruntime_version} +) list(GET OnnxRuntime_MIN_VERSION_LIST 1 OnnxRuntime_MIN_API_VERSION) if("${OnnxRuntime_API_VERSION}" LESS ${OnnxRuntime_MIN_API_VERSION}) - message(FATAL_ERROR "OnnxRuntime API version ${OnnxRuntime_MIN_API_VERSION} or greater required") + message( + FATAL_ERROR + "OnnxRuntime API version ${OnnxRuntime_MIN_API_VERSION} or greater required" + ) endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args( - OnnxRuntime - REQUIRED_VARS OnnxRuntime_LIBRARY OnnxRuntime_INCLUDE_DIR) + OnnxRuntime + REQUIRED_VARS OnnxRuntime_LIBRARY OnnxRuntime_INCLUDE_DIR +) add_library(OnnxRuntime SHARED IMPORTED) -set_property(TARGET OnnxRuntime PROPERTY IMPORTED_LOCATION ${OnnxRuntime_LIBRARY}) -set_property(TARGET OnnxRuntime PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${OnnxRuntime_INCLUDE_DIR}) -set_property(TARGET OnnxRuntime PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${OnnxRuntime_INCLUDE_DIR}) +set_property( + TARGET OnnxRuntime + PROPERTY IMPORTED_LOCATION ${OnnxRuntime_LIBRARY} +) +set_property( + TARGET OnnxRuntime + PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${OnnxRuntime_INCLUDE_DIR} +) +set_property( + TARGET OnnxRuntime + PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${OnnxRuntime_INCLUDE_DIR} +) mark_as_advanced(OnnxRuntime_FOUND OnnxRuntime_INCLUDE_DIR OnnxRuntime_LIBRARY) diff --git a/cmake/FindPythia8.cmake b/cmake/FindPythia8.cmake index 81486164ebc..e6f02ecad1c 100644 --- a/cmake/FindPythia8.cmake +++ b/cmake/FindPythia8.cmake @@ -3,27 +3,45 @@ # This module defines the `Pythia8` imported target that encodes all # necessary information in its target properties. -find_library(Pythia8_LIBRARY - NAMES Pythia8 pythia8 - HINTS ENV PYTHIA8_DIR PYTHIA8 - PATHS /opt/pythia8 /usr/local - DOC "The Pythia8 library") -find_path(Pythia8_INCLUDE_DIR - NAMES Pythia8/Pythia.h - HINTS ENV PYTHIA8_DIR PYTHIA8 - PATHS /opt/pythia8 /usr/local - DOC "The Pythia8 include directory") +find_library( + Pythia8_LIBRARY + NAMES Pythia8 pythia8 + HINTS + ENV PYTHIA8_DIR + PYTHIA8 + PATHS /opt/pythia8 /usr/local + DOC "The Pythia8 library" +) +find_path( + Pythia8_INCLUDE_DIR + NAMES Pythia8/Pythia.h + HINTS + ENV PYTHIA8_DIR + PYTHIA8 + PATHS /opt/pythia8 /usr/local + DOC "The Pythia8 include directory" +) file(READ "${Pythia8_INCLUDE_DIR}/Pythia8/Pythia.h" Pythia8_VERSION_FILE) -string(REGEX MATCH "#define PYTHIA_VERSION (8\.[0-9]+)" _ ${Pythia8_VERSION_FILE}) +string( + REGEX MATCH + "#define PYTHIA_VERSION (8\.[0-9]+)" + _ + ${Pythia8_VERSION_FILE} +) set(Pythia8_VERSION ${CMAKE_MATCH_1}) -find_package_handle_standard_args(Pythia8 - REQUIRED_VARS Pythia8_LIBRARY Pythia8_INCLUDE_DIR - VERSION_VAR Pythia8_VERSION) +find_package_handle_standard_args( + Pythia8 + REQUIRED_VARS Pythia8_LIBRARY Pythia8_INCLUDE_DIR + VERSION_VAR Pythia8_VERSION +) add_library(Pythia8 SHARED IMPORTED) set_property(TARGET Pythia8 PROPERTY IMPORTED_LOCATION ${Pythia8_LIBRARY}) -set_property(TARGET Pythia8 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Pythia8_INCLUDE_DIR}) +set_property( + TARGET Pythia8 + PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Pythia8_INCLUDE_DIR} +) mark_as_advanced(Pythia8_FOUND Pythia8_INCLUDE_DIR Pythia8_LIBRARY) diff --git a/cmake/FindSphinx.cmake b/cmake/FindSphinx.cmake index e230a3e58b5..cdfafee3850 100644 --- a/cmake/FindSphinx.cmake +++ b/cmake/FindSphinx.cmake @@ -10,35 +10,36 @@ set(_hints) # use python installation to find potential install locations for sphinx find_package(Python3 QUIET) if(Python3_EXECUTABLE) - execute_process( - COMMAND ${Python3_EXECUTABLE} -m site --user-base - OUTPUT_VARIABLE Python3_USER_BASE) - execute_process( - COMMAND ${Python3_EXECUTABLE} -c "import sys; print(sys.exec_prefix)" - OUTPUT_VARIABLE Python3_EXEC_PREFIX) - # strip newlines - string(REPLACE "\n" "" Python3_USER_BASE ${Python3_USER_BASE}) - string(REPLACE "\n" "" Python3_EXEC_PREFIX ${Python3_EXEC_PREFIX}) - # add derived binary dirs as hints - list(APPEND _hints "${Python3_USER_BASE}/bin" "${Python3_EXEC_PREFIX}/bin") + execute_process( + COMMAND ${Python3_EXECUTABLE} -m site --user-base + OUTPUT_VARIABLE Python3_USER_BASE + ) + execute_process( + COMMAND ${Python3_EXECUTABLE} -c "import sys; print(sys.exec_prefix)" + OUTPUT_VARIABLE Python3_EXEC_PREFIX + ) + # strip newlines + string(REPLACE "\n" "" Python3_USER_BASE ${Python3_USER_BASE}) + string(REPLACE "\n" "" Python3_EXEC_PREFIX ${Python3_EXEC_PREFIX}) + # add derived binary dirs as hints + list(APPEND _hints "${Python3_USER_BASE}/bin" "${Python3_EXEC_PREFIX}/bin") endif() # find sphinx executable if(_hints) - message(STATUS "Using additional Sphinx search hints:") - foreach(_hint IN LISTS _hints) - message(STATUS " ${_hint}") - endforeach() + message(STATUS "Using additional Sphinx search hints:") + foreach(_hint IN LISTS _hints) + message(STATUS " ${_hint}") + endforeach() endif() find_program( - Sphinx_EXECUTABLE - NAMES sphinx-build sphinx-build-3 - HINTS ${_hints} - DOC "Sphinx documentation generator") + Sphinx_EXECUTABLE + NAMES sphinx-build sphinx-build-3 + HINTS ${_hints} + DOC "Sphinx documentation generator" +) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args( - Sphinx - REQUIRED_VARS Sphinx_EXECUTABLE) +find_package_handle_standard_args(Sphinx REQUIRED_VARS Sphinx_EXECUTABLE) unset(_hints) diff --git a/cmake/FindTBB.cmake b/cmake/FindTBB.cmake index bd756313176..1ac26fb4a28 100644 --- a/cmake/FindTBB.cmake +++ b/cmake/FindTBB.cmake @@ -63,7 +63,6 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) - #============================================================================= # FindTBB helper functions and macros # @@ -71,143 +70,165 @@ # Use TBBConfig.cmake if possible. set(_tbb_find_quiet) -if (TBB_FIND_QUIETLY) - set(_tbb_find_quiet QUIET) -endif () +if(TBB_FIND_QUIETLY) + set(_tbb_find_quiet QUIET) +endif() set(_tbb_find_components) set(_tbb_find_optional_components) -foreach (_tbb_find_component IN LISTS TBB_FIND_COMPONENTS) - if (TBB_FIND_REQUIRED_${_tbb_find_component}) - list(APPEND _tbb_find_components "${_tbb_find_component}") - else () - list(APPEND _tbb_find_optional_components "${_tbb_find_component}") - endif () -endforeach () +foreach(_tbb_find_component IN LISTS TBB_FIND_COMPONENTS) + if(TBB_FIND_REQUIRED_${_tbb_find_component}) + list(APPEND _tbb_find_components "${_tbb_find_component}") + else() + list(APPEND _tbb_find_optional_components "${_tbb_find_component}") + endif() +endforeach() unset(_tbb_find_component) -find_package(TBB CONFIG ${_tbb_find_quiet} - COMPONENTS ${_tbb_find_components} - OPTIONAL_COMPONENTS ${_tbb_find_optional_components}) +find_package( + TBB + CONFIG + ${_tbb_find_quiet} + COMPONENTS ${_tbb_find_components} + OPTIONAL_COMPONENTS ${_tbb_find_optional_components} +) unset(_tbb_find_quiet) unset(_tbb_find_components) unset(_tbb_find_optional_components) -if (TBB_FOUND) - return () -endif () +if(TBB_FOUND) + return() +endif() #==================================================== # Fix the library path in case it is a linker script #==================================================== function(tbb_extract_real_library library real_library) - if(NOT UNIX OR NOT EXISTS ${library}) - set(${real_library} "${library}" PARENT_SCOPE) - return() - endif() - - #Read in the first 4 bytes and see if they are the ELF magic number - set(_elf_magic "7f454c46") - file(READ ${library} _hex_data OFFSET 0 LIMIT 4 HEX) - if(_hex_data STREQUAL _elf_magic) - #we have opened a elf binary so this is what - #we should link to - set(${real_library} "${library}" PARENT_SCOPE) - return() - endif() - - file(READ ${library} _data OFFSET 0 LIMIT 1024) - if("${_data}" MATCHES "INPUT \\(([^(]+)\\)") - #extract out the .so name from REGEX MATCH command - set(_proper_so_name "${CMAKE_MATCH_1}") - - #construct path to the real .so which is presumed to be in the same directory - #as the input file - get_filename_component(_so_dir "${library}" DIRECTORY) - set(${real_library} "${_so_dir}/${_proper_so_name}" PARENT_SCOPE) - else() - #unable to determine what this library is so just hope everything works - #and pass it unmodified. - set(${real_library} "${library}" PARENT_SCOPE) - endif() + if(NOT UNIX OR NOT EXISTS ${library}) + set(${real_library} "${library}" PARENT_SCOPE) + return() + endif() + + #Read in the first 4 bytes and see if they are the ELF magic number + set(_elf_magic "7f454c46") + file(READ ${library} _hex_data OFFSET 0 LIMIT 4 HEX) + if(_hex_data STREQUAL _elf_magic) + #we have opened a elf binary so this is what + #we should link to + set(${real_library} "${library}" PARENT_SCOPE) + return() + endif() + + file(READ ${library} _data OFFSET 0 LIMIT 1024) + if("${_data}" MATCHES "INPUT \\(([^(]+)\\)") + #extract out the .so name from REGEX MATCH command + set(_proper_so_name "${CMAKE_MATCH_1}") + + #construct path to the real .so which is presumed to be in the same directory + #as the input file + get_filename_component(_so_dir "${library}" DIRECTORY) + set(${real_library} "${_so_dir}/${_proper_so_name}" PARENT_SCOPE) + else() + #unable to determine what this library is so just hope everything works + #and pass it unmodified. + set(${real_library} "${library}" PARENT_SCOPE) + endif() endfunction() #=============================================== # Do the final processing for the package find. #=============================================== macro(findpkg_finish PREFIX TARGET_NAME) - if (${PREFIX}_INCLUDE_DIR AND ${PREFIX}_LIBRARY) - set(${PREFIX}_FOUND TRUE) - set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIR}) - set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARY}) - else () - if (${PREFIX}_FIND_REQUIRED AND NOT ${PREFIX}_FIND_QUIETLY) - message(FATAL_ERROR "Required library ${PREFIX} not found.") - endif () - endif () - - if (NOT TARGET "TBB::${TARGET_NAME}") - if (${PREFIX}_LIBRARY_RELEASE) - tbb_extract_real_library(${${PREFIX}_LIBRARY_RELEASE} real_release) - endif () - if (${PREFIX}_LIBRARY_DEBUG) - tbb_extract_real_library(${${PREFIX}_LIBRARY_DEBUG} real_debug) - endif () - add_library(TBB::${TARGET_NAME} UNKNOWN IMPORTED) - set_target_properties(TBB::${TARGET_NAME} PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${${PREFIX}_INCLUDE_DIR}") - if (${PREFIX}_LIBRARY_DEBUG AND ${PREFIX}_LIBRARY_RELEASE) - set_target_properties(TBB::${TARGET_NAME} PROPERTIES - IMPORTED_LOCATION "${real_release}" - IMPORTED_LOCATION_DEBUG "${real_debug}" - IMPORTED_LOCATION_RELEASE "${real_release}") - elseif (${PREFIX}_LIBRARY_RELEASE) - set_target_properties(TBB::${TARGET_NAME} PROPERTIES - IMPORTED_LOCATION "${real_release}") - elseif (${PREFIX}_LIBRARY_DEBUG) - set_target_properties(TBB::${TARGET_NAME} PROPERTIES - IMPORTED_LOCATION "${real_debug}") - endif () - endif () - - #mark the following variables as internal variables - mark_as_advanced(${PREFIX}_INCLUDE_DIR - ${PREFIX}_LIBRARY - ${PREFIX}_LIBRARY_DEBUG - ${PREFIX}_LIBRARY_RELEASE) + if(${PREFIX}_INCLUDE_DIR AND ${PREFIX}_LIBRARY) + set(${PREFIX}_FOUND TRUE) + set(${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIR}) + set(${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARY}) + else() + if(${PREFIX}_FIND_REQUIRED AND NOT ${PREFIX}_FIND_QUIETLY) + message(FATAL_ERROR "Required library ${PREFIX} not found.") + endif() + endif() + + if(NOT TARGET "TBB::${TARGET_NAME}") + if(${PREFIX}_LIBRARY_RELEASE) + tbb_extract_real_library(${${PREFIX}_LIBRARY_RELEASE} real_release) + endif() + if(${PREFIX}_LIBRARY_DEBUG) + tbb_extract_real_library(${${PREFIX}_LIBRARY_DEBUG} real_debug) + endif() + add_library(TBB::${TARGET_NAME} UNKNOWN IMPORTED) + set_target_properties( + TBB::${TARGET_NAME} + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${${PREFIX}_INCLUDE_DIR}" + ) + if(${PREFIX}_LIBRARY_DEBUG AND ${PREFIX}_LIBRARY_RELEASE) + set_target_properties( + TBB::${TARGET_NAME} + PROPERTIES + IMPORTED_LOCATION "${real_release}" + IMPORTED_LOCATION_DEBUG "${real_debug}" + IMPORTED_LOCATION_RELEASE "${real_release}" + ) + elseif(${PREFIX}_LIBRARY_RELEASE) + set_target_properties( + TBB::${TARGET_NAME} + PROPERTIES IMPORTED_LOCATION "${real_release}" + ) + elseif(${PREFIX}_LIBRARY_DEBUG) + set_target_properties( + TBB::${TARGET_NAME} + PROPERTIES IMPORTED_LOCATION "${real_debug}" + ) + endif() + endif() + + #mark the following variables as internal variables + mark_as_advanced( + ${PREFIX}_INCLUDE_DIR + ${PREFIX}_LIBRARY + ${PREFIX}_LIBRARY_DEBUG + ${PREFIX}_LIBRARY_RELEASE + ) endmacro() #=============================================== # Generate debug names from given release names #=============================================== macro(get_debug_names PREFIX) - foreach(i ${${PREFIX}}) - set(${PREFIX}_DEBUG ${${PREFIX}_DEBUG} ${i}d ${i}D ${i}_d ${i}_D ${i}_debug ${i}) - endforeach() + foreach(i ${${PREFIX}}) + set(${PREFIX}_DEBUG + ${${PREFIX}_DEBUG} + ${i}d + ${i}D + ${i}_d + ${i}_D + ${i}_debug + ${i} + ) + endforeach() endmacro() #=============================================== # See if we have env vars to help us find tbb #=============================================== macro(getenv_path VAR) - set(ENV_${VAR} $ENV{${VAR}}) - # replace won't work if var is blank - if (ENV_${VAR}) - string( REGEX REPLACE "\\\\" "/" ENV_${VAR} ${ENV_${VAR}} ) - endif () + set(ENV_${VAR} $ENV{${VAR}}) + # replace won't work if var is blank + if(ENV_${VAR}) + string(REGEX REPLACE "\\\\" "/" ENV_${VAR} ${ENV_${VAR}}) + endif() endmacro() #=============================================== # Couple a set of release AND debug libraries #=============================================== macro(make_library_set PREFIX) - if (${PREFIX}_RELEASE AND ${PREFIX}_DEBUG) - set(${PREFIX} optimized ${${PREFIX}_RELEASE} debug ${${PREFIX}_DEBUG}) - elseif (${PREFIX}_RELEASE) - set(${PREFIX} ${${PREFIX}_RELEASE}) - elseif (${PREFIX}_DEBUG) - set(${PREFIX} ${${PREFIX}_DEBUG}) - endif () + if(${PREFIX}_RELEASE AND ${PREFIX}_DEBUG) + set(${PREFIX} optimized ${${PREFIX}_RELEASE} debug ${${PREFIX}_DEBUG}) + elseif(${PREFIX}_RELEASE) + set(${PREFIX} ${${PREFIX}_RELEASE}) + elseif(${PREFIX}_DEBUG) + set(${PREFIX} ${${PREFIX}_DEBUG}) + endif() endmacro() - #============================================================================= # Now to actually find TBB # @@ -220,21 +241,22 @@ set(TBB_PREFIX_PATH ${TBB_ROOT} ${ENV_TBB_ROOT}) set(TBB_INC_SEARCH_PATH "") set(TBB_LIB_SEARCH_PATH "") - # If user built from sources set(TBB_BUILD_PREFIX $ENV{TBB_BUILD_PREFIX}) -if (TBB_BUILD_PREFIX AND ENV_TBB_ROOT) - getenv_path(TBB_BUILD_DIR) - if (NOT ENV_TBB_BUILD_DIR) - set(ENV_TBB_BUILD_DIR ${ENV_TBB_ROOT}/build) - endif () - - # include directory under ${ENV_TBB_ROOT}/include - list(APPEND TBB_LIB_SEARCH_PATH - ${ENV_TBB_BUILD_DIR}/${TBB_BUILD_PREFIX}_release - ${ENV_TBB_BUILD_DIR}/${TBB_BUILD_PREFIX}_debug) -endif () - +if(TBB_BUILD_PREFIX AND ENV_TBB_ROOT) + getenv_path(TBB_BUILD_DIR) + if(NOT ENV_TBB_BUILD_DIR) + set(ENV_TBB_BUILD_DIR ${ENV_TBB_ROOT}/build) + endif() + + # include directory under ${ENV_TBB_ROOT}/include + list( + APPEND + TBB_LIB_SEARCH_PATH + ${ENV_TBB_BUILD_DIR}/${TBB_BUILD_PREFIX}_release + ${ENV_TBB_BUILD_DIR}/${TBB_BUILD_PREFIX}_debug + ) +endif() # For Windows, let's assume that the user might be using the precompiled # TBB packages from the main website. These use a rather awkward directory @@ -246,157 +268,181 @@ endif () # to detect the "best" version to use. The user will have to manually # select the right files. (Chances are the distributions are shipping their # custom version of tbb, anyway, so the problem is probably nonexistent.) -if (WIN32 AND MSVC) - set(COMPILER_PREFIX "vc7.1") - if (MSVC_VERSION EQUAL 1400) - set(COMPILER_PREFIX "vc8") - elseif(MSVC_VERSION EQUAL 1500) - set(COMPILER_PREFIX "vc9") - elseif(MSVC_VERSION EQUAL 1600) - set(COMPILER_PREFIX "vc10") - elseif(MSVC_VERSION EQUAL 1700) - set(COMPILER_PREFIX "vc11") - elseif(MSVC_VERSION EQUAL 1800) - set(COMPILER_PREFIX "vc12") - elseif(MSVC_VERSION GREATER_EQUAL 1900) - set(COMPILER_PREFIX "vc14") - endif () - - # for each prefix path, add ia32/64\${COMPILER_PREFIX}\lib to the lib search path - foreach (dir IN LISTS TBB_PREFIX_PATH) - if (CMAKE_CL_64) - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia64/${COMPILER_PREFIX}/lib) - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia64/${COMPILER_PREFIX}) - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/${COMPILER_PREFIX}/lib) - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64/${COMPILER_PREFIX}) - else () - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/${COMPILER_PREFIX}/lib) - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32/${COMPILER_PREFIX}) - endif () - endforeach () -endif () +if(WIN32 AND MSVC) + set(COMPILER_PREFIX "vc7.1") + if(MSVC_VERSION EQUAL 1400) + set(COMPILER_PREFIX "vc8") + elseif(MSVC_VERSION EQUAL 1500) + set(COMPILER_PREFIX "vc9") + elseif(MSVC_VERSION EQUAL 1600) + set(COMPILER_PREFIX "vc10") + elseif(MSVC_VERSION EQUAL 1700) + set(COMPILER_PREFIX "vc11") + elseif(MSVC_VERSION EQUAL 1800) + set(COMPILER_PREFIX "vc12") + elseif(MSVC_VERSION GREATER_EQUAL 1900) + set(COMPILER_PREFIX "vc14") + endif() + + # for each prefix path, add ia32/64\${COMPILER_PREFIX}\lib to the lib search path + foreach(dir IN LISTS TBB_PREFIX_PATH) + if(CMAKE_CL_64) + list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia64/${COMPILER_PREFIX}/lib) + list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia64/${COMPILER_PREFIX}) + list( + APPEND + TBB_LIB_SEARCH_PATH + ${dir}/intel64/${COMPILER_PREFIX}/lib + ) + list( + APPEND + TBB_LIB_SEARCH_PATH + ${dir}/lib/intel64/${COMPILER_PREFIX} + ) + else() + list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/${COMPILER_PREFIX}/lib) + list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32/${COMPILER_PREFIX}) + endif() + endforeach() +endif() # For OS X binary distribution, choose libc++ based libraries for Mavericks (10.9) # and above and AppleClang -if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND - NOT CMAKE_SYSTEM_VERSION VERSION_LESS 13.0) - set (USE_LIBCXX OFF) - cmake_policy(GET CMP0025 POLICY_VAR) - - if (POLICY_VAR STREQUAL "NEW") - if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") - set (USE_LIBCXX ON) - endif () - else () - if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - set (USE_LIBCXX ON) - endif () - endif () - - if (USE_LIBCXX) - foreach (dir IN LISTS TBB_PREFIX_PATH) - list (APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/libc++ ${dir}/libc++/lib) - endforeach () - endif () -endif () +if( + CMAKE_SYSTEM_NAME STREQUAL "Darwin" + AND NOT CMAKE_SYSTEM_VERSION VERSION_LESS 13.0 +) + set(USE_LIBCXX OFF) + cmake_policy(GET CMP0025 POLICY_VAR) + + if(POLICY_VAR STREQUAL "NEW") + if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + set(USE_LIBCXX ON) + endif() + else() + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(USE_LIBCXX ON) + endif() + endif() + + if(USE_LIBCXX) + foreach(dir IN LISTS TBB_PREFIX_PATH) + list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/libc++ ${dir}/libc++/lib) + endforeach() + endif() +endif() # check compiler ABI -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(COMPILER_PREFIX) - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) - list(APPEND COMPILER_PREFIX "gcc4.8") - endif() - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) - list(APPEND COMPILER_PREFIX "gcc4.7") - endif() - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) - list(APPEND COMPILER_PREFIX "gcc4.4") - endif() - list(APPEND COMPILER_PREFIX "gcc4.1") +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(COMPILER_PREFIX) + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) + list(APPEND COMPILER_PREFIX "gcc4.8") + endif() + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + list(APPEND COMPILER_PREFIX "gcc4.7") + endif() + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) + list(APPEND COMPILER_PREFIX "gcc4.4") + endif() + list(APPEND COMPILER_PREFIX "gcc4.1") elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(COMPILER_PREFIX) - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0) # Complete guess - list(APPEND COMPILER_PREFIX "gcc4.8") - endif() - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.6) - list(APPEND COMPILER_PREFIX "gcc4.7") - endif() - list(APPEND COMPILER_PREFIX "gcc4.4") + set(COMPILER_PREFIX) + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0) # Complete guess + list(APPEND COMPILER_PREFIX "gcc4.8") + endif() + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.6) + list(APPEND COMPILER_PREFIX "gcc4.7") + endif() + list(APPEND COMPILER_PREFIX "gcc4.4") else() # Assume compatibility with 4.4 for other compilers - list(APPEND COMPILER_PREFIX "gcc4.4") -endif () + list(APPEND COMPILER_PREFIX "gcc4.4") +endif() # if platform architecture is explicitly specified set(TBB_ARCH_PLATFORM $ENV{TBB_ARCH_PLATFORM}) -if (TBB_ARCH_PLATFORM) - foreach (dir IN LISTS TBB_PREFIX_PATH) - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/${TBB_ARCH_PLATFORM}/lib) - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/${TBB_ARCH_PLATFORM}) - endforeach () -endif () - -foreach (dir IN LISTS TBB_PREFIX_PATH) - foreach (prefix IN LISTS COMPILER_PREFIX) - if (CMAKE_SIZEOF_VOID_P EQUAL 8) - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64) - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64/${prefix}) - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/lib) - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/${prefix}/lib) - else () - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32) - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32/${prefix}) - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/lib) - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/${prefix}/lib) - endif () - endforeach() -endforeach () +if(TBB_ARCH_PLATFORM) + foreach(dir IN LISTS TBB_PREFIX_PATH) + list(APPEND TBB_LIB_SEARCH_PATH ${dir}/${TBB_ARCH_PLATFORM}/lib) + list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/${TBB_ARCH_PLATFORM}) + endforeach() +endif() + +foreach(dir IN LISTS TBB_PREFIX_PATH) + foreach(prefix IN LISTS COMPILER_PREFIX) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64) + list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64/${prefix}) + list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/lib) + list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/${prefix}/lib) + else() + list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32) + list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32/${prefix}) + list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/lib) + list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/${prefix}/lib) + endif() + endforeach() +endforeach() # add general search paths -foreach (dir IN LISTS TBB_PREFIX_PATH) - list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib ${dir}/Lib ${dir}/lib/tbb - ${dir}/Libs) - list(APPEND TBB_INC_SEARCH_PATH ${dir}/include ${dir}/Include - ${dir}/include/tbb) -endforeach () +foreach(dir IN LISTS TBB_PREFIX_PATH) + list( + APPEND + TBB_LIB_SEARCH_PATH + ${dir}/lib + ${dir}/Lib + ${dir}/lib/tbb + ${dir}/Libs + ) + list( + APPEND + TBB_INC_SEARCH_PATH + ${dir}/include + ${dir}/Include + ${dir}/include/tbb + ) +endforeach() set(TBB_LIBRARY_NAMES tbb) get_debug_names(TBB_LIBRARY_NAMES) - -find_path(TBB_INCLUDE_DIR - NAMES tbb/tbb.h - PATHS ${TBB_INC_SEARCH_PATH}) - -find_library(TBB_LIBRARY_RELEASE - NAMES ${TBB_LIBRARY_NAMES} - PATHS ${TBB_LIB_SEARCH_PATH}) -find_library(TBB_LIBRARY_DEBUG - NAMES ${TBB_LIBRARY_NAMES_DEBUG} - PATHS ${TBB_LIB_SEARCH_PATH}) +find_path(TBB_INCLUDE_DIR NAMES tbb/tbb.h PATHS ${TBB_INC_SEARCH_PATH}) + +find_library( + TBB_LIBRARY_RELEASE + NAMES ${TBB_LIBRARY_NAMES} + PATHS ${TBB_LIB_SEARCH_PATH} +) +find_library( + TBB_LIBRARY_DEBUG + NAMES ${TBB_LIBRARY_NAMES_DEBUG} + PATHS ${TBB_LIB_SEARCH_PATH} +) make_library_set(TBB_LIBRARY) findpkg_finish(TBB tbb) #if we haven't found TBB no point on going any further -if (NOT TBB_FOUND) - return() -endif () +if(NOT TBB_FOUND) + return() +endif() #============================================================================= # Look for TBB's malloc package set(TBB_MALLOC_LIBRARY_NAMES tbbmalloc) get_debug_names(TBB_MALLOC_LIBRARY_NAMES) -find_path(TBB_MALLOC_INCLUDE_DIR - NAMES tbb/tbb.h - PATHS ${TBB_INC_SEARCH_PATH}) - -find_library(TBB_MALLOC_LIBRARY_RELEASE - NAMES ${TBB_MALLOC_LIBRARY_NAMES} - PATHS ${TBB_LIB_SEARCH_PATH}) -find_library(TBB_MALLOC_LIBRARY_DEBUG - NAMES ${TBB_MALLOC_LIBRARY_NAMES_DEBUG} - PATHS ${TBB_LIB_SEARCH_PATH}) +find_path(TBB_MALLOC_INCLUDE_DIR NAMES tbb/tbb.h PATHS ${TBB_INC_SEARCH_PATH}) + +find_library( + TBB_MALLOC_LIBRARY_RELEASE + NAMES ${TBB_MALLOC_LIBRARY_NAMES} + PATHS ${TBB_LIB_SEARCH_PATH} +) +find_library( + TBB_MALLOC_LIBRARY_DEBUG + NAMES ${TBB_MALLOC_LIBRARY_NAMES_DEBUG} + PATHS ${TBB_LIB_SEARCH_PATH} +) make_library_set(TBB_MALLOC_LIBRARY) findpkg_finish(TBB_MALLOC tbbmalloc) @@ -406,51 +452,75 @@ findpkg_finish(TBB_MALLOC tbbmalloc) set(TBB_MALLOC_PROXY_LIBRARY_NAMES tbbmalloc_proxy) get_debug_names(TBB_MALLOC_PROXY_LIBRARY_NAMES) -find_path(TBB_MALLOC_PROXY_INCLUDE_DIR - NAMES tbb/tbbmalloc_proxy.h - PATHS ${TBB_INC_SEARCH_PATH}) - -find_library(TBB_MALLOC_PROXY_LIBRARY_RELEASE - NAMES ${TBB_MALLOC_PROXY_LIBRARY_NAMES} - PATHS ${TBB_LIB_SEARCH_PATH}) -find_library(TBB_MALLOC_PROXY_LIBRARY_DEBUG - NAMES ${TBB_MALLOC_PROXY_LIBRARY_NAMES_DEBUG} - PATHS ${TBB_LIB_SEARCH_PATH}) +find_path( + TBB_MALLOC_PROXY_INCLUDE_DIR + NAMES tbb/tbbmalloc_proxy.h + PATHS ${TBB_INC_SEARCH_PATH} +) + +find_library( + TBB_MALLOC_PROXY_LIBRARY_RELEASE + NAMES ${TBB_MALLOC_PROXY_LIBRARY_NAMES} + PATHS ${TBB_LIB_SEARCH_PATH} +) +find_library( + TBB_MALLOC_PROXY_LIBRARY_DEBUG + NAMES ${TBB_MALLOC_PROXY_LIBRARY_NAMES_DEBUG} + PATHS ${TBB_LIB_SEARCH_PATH} +) make_library_set(TBB_MALLOC_PROXY_LIBRARY) findpkg_finish(TBB_MALLOC_PROXY tbbmalloc_proxy) - #============================================================================= #parse all the version numbers from tbb if(NOT TBB_VERSION) - if (EXISTS "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h") - file(STRINGS - "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h" - TBB_VERSION_CONTENTS - REGEX "VERSION") - else() - #only read the start of the file - file(STRINGS - "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" - TBB_VERSION_CONTENTS - REGEX "VERSION") - endif() - - string(REGEX REPLACE - ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" - TBB_VERSION_MAJOR "${TBB_VERSION_CONTENTS}") - - string(REGEX REPLACE - ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" - TBB_VERSION_MINOR "${TBB_VERSION_CONTENTS}") - - string(REGEX REPLACE - ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" - TBB_INTERFACE_VERSION "${TBB_VERSION_CONTENTS}") - - string(REGEX REPLACE - ".*#define TBB_COMPATIBLE_INTERFACE_VERSION ([0-9]+).*" "\\1" - TBB_COMPATIBLE_INTERFACE_VERSION "${TBB_VERSION_CONTENTS}") - + if(EXISTS "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h") + file( + STRINGS + "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h" + TBB_VERSION_CONTENTS + REGEX "VERSION" + ) + else() + #only read the start of the file + file( + STRINGS + "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" + TBB_VERSION_CONTENTS + REGEX "VERSION" + ) + endif() + + string( + REGEX REPLACE + ".*#define TBB_VERSION_MAJOR ([0-9]+).*" + "\\1" + TBB_VERSION_MAJOR + "${TBB_VERSION_CONTENTS}" + ) + + string( + REGEX REPLACE + ".*#define TBB_VERSION_MINOR ([0-9]+).*" + "\\1" + TBB_VERSION_MINOR + "${TBB_VERSION_CONTENTS}" + ) + + string( + REGEX REPLACE + ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" + "\\1" + TBB_INTERFACE_VERSION + "${TBB_VERSION_CONTENTS}" + ) + + string( + REGEX REPLACE + ".*#define TBB_COMPATIBLE_INTERFACE_VERSION ([0-9]+).*" + "\\1" + TBB_COMPATIBLE_INTERFACE_VERSION + "${TBB_VERSION_CONTENTS}" + ) endif() diff --git a/cmake/GetGitRevisionDescription.cmake b/cmake/GetGitRevisionDescription.cmake index 8ab03bc5f0b..b8bb6caf4a4 100644 --- a/cmake/GetGitRevisionDescription.cmake +++ b/cmake/GetGitRevisionDescription.cmake @@ -37,7 +37,7 @@ # http://www.boost.org/LICENSE_1_0.txt) if(__get_git_revision_description) - return() + return() endif() set(__get_git_revision_description YES) @@ -46,123 +46,127 @@ set(__get_git_revision_description YES) get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) function(get_git_head_revision _refspecvar _hashvar) - set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") - set(GIT_DIR "${GIT_PARENT_DIR}/.git") - while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories - set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}") - get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH) - if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT) - # We have reached the root directory, we are not in git - set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE) - set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE) - return() - endif() - set(GIT_DIR "${GIT_PARENT_DIR}/.git") - endwhile() - # check if this is a submodule - if(NOT IS_DIRECTORY ${GIT_DIR}) - file(READ ${GIT_DIR} submodule) - string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule}) - get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH) - get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE) - endif() - set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data") - if(NOT EXISTS "${GIT_DATA}") - file(MAKE_DIRECTORY "${GIT_DATA}") - endif() + set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + set(GIT_DIR "${GIT_PARENT_DIR}/.git") + while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories + set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}") + get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH) + if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT) + # We have reached the root directory, we are not in git + set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE) + set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE) + return() + endif() + set(GIT_DIR "${GIT_PARENT_DIR}/.git") + endwhile() + # check if this is a submodule + if(NOT IS_DIRECTORY ${GIT_DIR}) + file(READ ${GIT_DIR} submodule) + string( + REGEX REPLACE + "gitdir: (.*)\n$" + "\\1" + GIT_DIR_RELATIVE + ${submodule} + ) + get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH) + get_filename_component( + GIT_DIR + ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} + ABSOLUTE + ) + endif() + set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data") + if(NOT EXISTS "${GIT_DATA}") + file(MAKE_DIRECTORY "${GIT_DATA}") + endif() - if(NOT EXISTS "${GIT_DIR}/HEAD") - return() - endif() - set(HEAD_FILE "${GIT_DATA}/HEAD") - configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY) + if(NOT EXISTS "${GIT_DIR}/HEAD") + return() + endif() + set(HEAD_FILE "${GIT_DATA}/HEAD") + configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY) - configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" - "${GIT_DATA}/grabRef.cmake" - @ONLY) - include("${GIT_DATA}/grabRef.cmake") + configure_file( + "${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" + "${GIT_DATA}/grabRef.cmake" + @ONLY + ) + include("${GIT_DATA}/grabRef.cmake") - set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE) - set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE) + set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE) + set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE) endfunction() function(git_describe _var) - if(NOT GIT_FOUND) - find_package(Git QUIET) - endif() - get_git_head_revision(refspec hash) - if(NOT GIT_FOUND) - set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) - return() - endif() - if(NOT hash) - set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) - return() - endif() + if(NOT GIT_FOUND) + find_package(Git QUIET) + endif() + get_git_head_revision(refspec hash) + if(NOT GIT_FOUND) + set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) + return() + endif() + if(NOT hash) + set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) + return() + endif() - # TODO sanitize - #if((${ARGN}" MATCHES "&&") OR - # (ARGN MATCHES "||") OR - # (ARGN MATCHES "\\;")) - # message("Please report the following error to the project!") - # message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}") - #endif() + # TODO sanitize + #if((${ARGN}" MATCHES "&&") OR + # (ARGN MATCHES "||") OR + # (ARGN MATCHES "\\;")) + # message("Please report the following error to the project!") + # message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}") + #endif() - #message(STATUS "Arguments to execute_process: ${ARGN}") + #message(STATUS "Arguments to execute_process: ${ARGN}") - execute_process(COMMAND - "${GIT_EXECUTABLE}" - describe - ${hash} - ${ARGN} - WORKING_DIRECTORY - "${CMAKE_CURRENT_SOURCE_DIR}" - RESULT_VARIABLE - res - OUTPUT_VARIABLE - out - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(NOT res EQUAL 0) - set(out "${out}-${res}-NOTFOUND") - endif() + execute_process( + COMMAND "${GIT_EXECUTABLE}" describe ${hash} ${ARGN} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + RESULT_VARIABLE res + OUTPUT_VARIABLE out + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(NOT res EQUAL 0) + set(out "${out}-${res}-NOTFOUND") + endif() - set(${_var} "${out}" PARENT_SCOPE) + set(${_var} "${out}" PARENT_SCOPE) endfunction() function(git_get_exact_tag _var) - git_describe(out --exact-match ${ARGN}) - set(${_var} "${out}" PARENT_SCOPE) + git_describe(out --exact-match ${ARGN}) + set(${_var} "${out}" PARENT_SCOPE) endfunction() function(git_local_changes _var) - if(NOT GIT_FOUND) - find_package(Git QUIET) - endif() - get_git_head_revision(refspec hash) - if(NOT GIT_FOUND) - set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) - return() - endif() - if(NOT hash) - set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) - return() - endif() + if(NOT GIT_FOUND) + find_package(Git QUIET) + endif() + get_git_head_revision(refspec hash) + if(NOT GIT_FOUND) + set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) + return() + endif() + if(NOT hash) + set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) + return() + endif() - execute_process(COMMAND - "${GIT_EXECUTABLE}" - diff-index --quiet HEAD -- - WORKING_DIRECTORY - "${CMAKE_CURRENT_SOURCE_DIR}" - RESULT_VARIABLE - res - OUTPUT_VARIABLE - out - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(res EQUAL 0) - set(${_var} "CLEAN" PARENT_SCOPE) - else() - set(${_var} "DIRTY" PARENT_SCOPE) - endif() + execute_process( + COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD -- + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + RESULT_VARIABLE res + OUTPUT_VARIABLE out + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(res EQUAL 0) + set(${_var} "CLEAN" PARENT_SCOPE) + else() + set(${_var} "DIRTY" PARENT_SCOPE) + endif() endfunction() diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index b9f309d4da3..1f5e8a1aa6c 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -17,7 +17,7 @@ list(APPEND sphinx_command "-W;--keep-going") list(APPEND sphinx_command "-t;run_doxygen;-t;lazy_autodoc") if(DEFINED ENV{CI}) - list(APPEND sphinx_command "-b;linkcheck") + list(APPEND sphinx_command "-b;linkcheck") endif() list(APPEND sphinx_command "${CMAKE_CURRENT_SOURCE_DIR}") @@ -27,11 +27,14 @@ message(${sphinx_command}) # standard target to build the documentation without automatic API generation add_custom_target( - docs - COMMAND ${Sphinx_EXECUTABLE} ${sphinx_command} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Build documentation") + docs + COMMAND ${Sphinx_EXECUTABLE} ${sphinx_command} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Build documentation" +) install( - DIRECTORY ${sphinx_html}/ - DESTINATION ${CMAKE_INSTALL_DOCDIR}/Acts OPTIONAL) + DIRECTORY ${sphinx_html}/ + DESTINATION ${CMAKE_INSTALL_DOCDIR}/Acts + OPTIONAL +) diff --git a/thirdparty/FRNN/CMakeLists.txt b/thirdparty/FRNN/CMakeLists.txt index 3399ab3289b..cd36fc9a330 100644 --- a/thirdparty/FRNN/CMakeLists.txt +++ b/thirdparty/FRNN/CMakeLists.txt @@ -10,13 +10,17 @@ include(FetchContent) message(STATUS "Building FRNN as part of the ACTS project") # Declare where to get frnncontent from -FetchContent_Declare( frnncontent ${ACTS_FRNN_SOURCE} ) +FetchContent_Declare(frnncontent ${ACTS_FRNN_SOURCE}) # FRNN does not provide a CMakeLists.txt, so we use a custom one. Because of this, # we have to implement the populate step manually FetchContent_GetProperties(frnncontent) if(NOT frnncontent_POPULATED) - FetchContent_Populate(frnncontent) - configure_file(CMakeLists.txt.in "${frnncontent_SOURCE_DIR}/CMakeLists.txt" COPYONLY) - add_subdirectory(${frnncontent_SOURCE_DIR} ${frnncontent_BINARY_DIR}) + FetchContent_Populate(frnncontent) + configure_file( + CMakeLists.txt.in + "${frnncontent_SOURCE_DIR}/CMakeLists.txt" + COPYONLY + ) + add_subdirectory(${frnncontent_SOURCE_DIR} ${frnncontent_BINARY_DIR}) endif() diff --git a/thirdparty/actsvg/CMakeLists.txt b/thirdparty/actsvg/CMakeLists.txt index 5b1622d3290..1fea9d85b2b 100644 --- a/thirdparty/actsvg/CMakeLists.txt +++ b/thirdparty/actsvg/CMakeLists.txt @@ -7,12 +7,12 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # CMake include(s). -include( FetchContent ) +include(FetchContent) # Tell the user what's happening. -message( STATUS "Building actsvg as part of the ACTS project" ) +message(STATUS "Building actsvg as part of the ACTS project") -FetchContent_Declare( actsvg ${ACTS_ACTSVG_SOURCE} ) +FetchContent_Declare(actsvg ${ACTS_ACTSVG_SOURCE}) # Now set up its build. -FetchContent_MakeAvailable( actsvg ) +FetchContent_MakeAvailable(actsvg) diff --git a/thirdparty/algebra-plugins/CMakeLists.txt b/thirdparty/algebra-plugins/CMakeLists.txt index 75fb0f9ad77..d09880b2615 100644 --- a/thirdparty/algebra-plugins/CMakeLists.txt +++ b/thirdparty/algebra-plugins/CMakeLists.txt @@ -10,37 +10,71 @@ include(FetchContent) # Tell the user what's happening. -message( STATUS "Building algebra-plugins as part of the Acts project" ) +message(STATUS "Building algebra-plugins as part of the Acts project") -FetchContent_Declare( AlgebraPlugins ${ACTS_ALGEBRAPLUGINS_SOURCE} ) +FetchContent_Declare(AlgebraPlugins ${ACTS_ALGEBRAPLUGINS_SOURCE}) # Options used in the build of Algebra Plugins. -set(ALGEBRA_PLUGINS_BUILD_TESTING FALSE CACHE BOOL - "Turn off the build of the Algebra Plugins unit tests") -set(ALGEBRA_PLUGINS_INCLUDE_EIGEN TRUE CACHE BOOL - "Turn on the build of algebra::eigen") -set(ALGEBRA_PLUGINS_INCLUDE_VC FALSE CACHE BOOL - "Turn off the build of algebra::vc_array") -set(ALGEBRA_PLUGINS_INCLUDE_VECMEM TRUE CACHE BOOL - "Turn on the build of algebra::vecmem_array") +set(ALGEBRA_PLUGINS_BUILD_TESTING + FALSE + CACHE BOOL + "Turn off the build of the Algebra Plugins unit tests" +) +set(ALGEBRA_PLUGINS_INCLUDE_EIGEN + TRUE + CACHE BOOL + "Turn on the build of algebra::eigen" +) +set(ALGEBRA_PLUGINS_INCLUDE_VC + FALSE + CACHE BOOL + "Turn off the build of algebra::vc_array" +) +set(ALGEBRA_PLUGINS_INCLUDE_VECMEM + TRUE + CACHE BOOL + "Turn on the build of algebra::vecmem_array" +) # Build smatrix plugin only when it needs to be # ROOT is not provided in native github compilers :/ -set(ALGEBRA_PLUGINS_INCLUDE_SMATRIX ${DETRAY_SMATRIX_PLUGIN} - CACHE BOOL "Turn on/off the build of algebra::smatrix") - -set(ALGEBRA_PLUGINS_SETUP_EIGEN3 OFF CACHE BOOL - "Do not have Algebra Plugins set up Eigen3 for itself") -set(ALGEBRA_PLUGINS_SETUP_VC OFF CACHE BOOL - "Do not have Algebra Plugins set up Vc for itself") -set(ALGEBRA_PLUGINS_USE_SYSTEM_VC OFF CACHE BOOL - "Have Algebra Plugins build Vc itself") -set(ALGEBRA_PLUGINS_SETUP_VECMEM FALSE CACHE BOOL - "Do not set up VecMem in Algebra Plugins") -set(ALGEBRA_PLUGINS_SETUP_GOOGLETEST FALSE CACHE BOOL - "Do not set up GoogleTest in Algebra Plugins") - -set(ALGEBRA_PLUGINS_SETUP_BENCHMARK FALSE CACHE BOOL "Do not setup Algebra Plugins benchmark") +set(ALGEBRA_PLUGINS_INCLUDE_SMATRIX + ${DETRAY_SMATRIX_PLUGIN} + CACHE BOOL + "Turn on/off the build of algebra::smatrix" +) + +set(ALGEBRA_PLUGINS_SETUP_EIGEN3 + OFF + CACHE BOOL + "Do not have Algebra Plugins set up Eigen3 for itself" +) +set(ALGEBRA_PLUGINS_SETUP_VC + OFF + CACHE BOOL + "Do not have Algebra Plugins set up Vc for itself" +) +set(ALGEBRA_PLUGINS_USE_SYSTEM_VC + OFF + CACHE BOOL + "Have Algebra Plugins build Vc itself" +) +set(ALGEBRA_PLUGINS_SETUP_VECMEM + FALSE + CACHE BOOL + "Do not set up VecMem in Algebra Plugins" +) +set(ALGEBRA_PLUGINS_SETUP_GOOGLETEST + FALSE + CACHE BOOL + "Do not set up GoogleTest in Algebra Plugins" +) + +set(ALGEBRA_PLUGINS_SETUP_BENCHMARK + FALSE + CACHE BOOL + "Do not setup Algebra Plugins benchmark" +) # Now set up its build. -FetchContent_MakeAvailable( AlgebraPlugins ) +FetchContent_MakeAvailable(AlgebraPlugins) diff --git a/thirdparty/covfie/CMakeLists.txt b/thirdparty/covfie/CMakeLists.txt index bfd6da88215..0d6d71cf47e 100644 --- a/thirdparty/covfie/CMakeLists.txt +++ b/thirdparty/covfie/CMakeLists.txt @@ -10,23 +10,27 @@ include(FetchContent) # Tell the user what's happening. -message( STATUS "Building Covfie as part of the Acts project" ) +message(STATUS "Building Covfie as part of the Acts project") -set( COVFIE_VERSION "v${_acts_covfie_version}") +set(COVFIE_VERSION "v${_acts_covfie_version}") # Declare where to get covfie from. -FetchContent_Declare( covfie ${ACTS_COVFIE_SOURCE} ) +FetchContent_Declare(covfie ${ACTS_COVFIE_SOURCE}) # Options used for covfie. -set( COVFIE_BUILD_EXAMPLES OFF CACHE BOOL "Build covfie examples") -set( COVFIE_BUILD_TESTS OFF CACHE BOOL "Build covfie tests") -set( COVFIE_BUILD_BENCHMARKS OFF CACHE BOOL "Build covfie benchmarks") +set(COVFIE_BUILD_EXAMPLES OFF CACHE BOOL "Build covfie examples") +set(COVFIE_BUILD_TESTS OFF CACHE BOOL "Build covfie tests") +set(COVFIE_BUILD_BENCHMARKS OFF CACHE BOOL "Build covfie benchmarks") -set( COVFIE_PLATFORM_CPU ON CACHE BOOL "Enable covfie CPU platform") -set( COVFIE_PLATFORM_CUDA ${ACTS_BUILD_PLUGIN_CUDA} CACHE BOOL "Enable covfie CUDA platform") +set(COVFIE_PLATFORM_CPU ON CACHE BOOL "Enable covfie CPU platform") +set(COVFIE_PLATFORM_CUDA + ${ACTS_BUILD_PLUGIN_CUDA} + CACHE BOOL + "Enable covfie CUDA platform" +) -set( COVFIE_REQUIRE_CXX20 OFF CACHE BOOL "Enable covfie C++20 requirement") -set( COVFIE_QUIET ON CACHE BOOL "Quiet covfie feature warnings") +set(COVFIE_REQUIRE_CXX20 OFF CACHE BOOL "Enable covfie C++20 requirement") +set(COVFIE_QUIET ON CACHE BOOL "Quiet covfie feature warnings") # Now set up its build. -FetchContent_MakeAvailable( covfie ) +FetchContent_MakeAvailable(covfie) diff --git a/thirdparty/detray/CMakeLists.txt b/thirdparty/detray/CMakeLists.txt index c93c79cc72e..c24b260b0ff 100644 --- a/thirdparty/detray/CMakeLists.txt +++ b/thirdparty/detray/CMakeLists.txt @@ -7,56 +7,76 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # CMake include(s). -include( FetchContent ) +include(FetchContent) # Tell the user what's happening. -message( STATUS "Building Detray as part of the Acts project" ) +message(STATUS "Building Detray as part of the Acts project") -set( DETRAY_VERSION "v${_acts_detray_version}") +set(DETRAY_VERSION "v${_acts_detray_version}") # Declare where to get Detray from. -FetchContent_Declare( Detray ${ACTS_DETRAY_SOURCE} ) +FetchContent_Declare(Detray ${ACTS_DETRAY_SOURCE}) # Options used in the build of Detray. if(ACTS_CUSTOM_SCALARTYPE) - set(ACTS_DETRAY_SCALARTYPE ${ACTS_CUSTOM_SCALARTYPE}) + set(ACTS_DETRAY_SCALARTYPE ${ACTS_CUSTOM_SCALARTYPE}) else() - set(ACTS_DETRAY_SCALARTYPE "double") + set(ACTS_DETRAY_SCALARTYPE "double") endif() -set( DETRAY_CUSTOM_SCALARTYPE "${ACTS_DETRAY_SCALARTYPE}" CACHE STRING - "Scalar type to use in the Detray code" ) - -set( DETRAY_BUILD_TESTING OFF CACHE BOOL - "Turn off the build of the Detray unit tests" ) -set( DETRAY_BUILD_TUTORIALS OFF CACHE BOOL - "Turn off the build of the Detray tutorials" ) -set( DETRAY_EIGEN_PLUGIN ON CACHE BOOL - "Turn on the build of the Detray Eigen code" ) -set( DETRAY_VC_PLUGIN OFF CACHE BOOL - "Turn off the build of the Detray Vc code" ) - -set( DETRAY_SETUP_VECMEM OFF CACHE BOOL - "Do not set up VecMem as part of Detray" ) -set( DETRAY_SETUP_ALGEBRA_PLUGINS OFF CACHE BOOL - "Do not set up Algebra Plugins as part of Detray" ) -set( DETRAY_SETUP_GOOGLETEST OFF CACHE BOOL - "Do not set up GoogleTest as part of Detray" ) -set( DETRAY_SETUP_BENCHMARK OFF CACHE BOOL - "Do not set up Google Benchmark as part of Detray" ) -set( DETRAY_SETUP_THRUST ON CACHE BOOL - "Set up Thrust as part of Detray" ) -set( DETRAY_SETUP_COVFIE OFF CACHE BOOL - "Do not set up covfie as part of Detray" ) -set( DETRAY_SETUP_NLOHMANN OFF CACHE BOOL - "Do not set up Nlohmann as part of Detray" ) -set( DETRAY_SETUP_ACTSVG OFF CACHE BOOL - "Do not set up Actsvg as part of Detray" ) -set( DETRAY_SETUP_DFELIBS ON CACHE BOOL - "Do not set up Dfelibs as part of Detray" ) -set( DETRAY_SVG_DISPLAY OFF CACHE BOOL - "No not build the ActSVG display module" ) +set(DETRAY_CUSTOM_SCALARTYPE + "${ACTS_DETRAY_SCALARTYPE}" + CACHE STRING + "Scalar type to use in the Detray code" +) +set(DETRAY_BUILD_TESTING + OFF + CACHE BOOL + "Turn off the build of the Detray unit tests" +) +set(DETRAY_BUILD_TUTORIALS + OFF + CACHE BOOL + "Turn off the build of the Detray tutorials" +) +set(DETRAY_EIGEN_PLUGIN + ON + CACHE BOOL + "Turn on the build of the Detray Eigen code" +) +set(DETRAY_VC_PLUGIN OFF CACHE BOOL "Turn off the build of the Detray Vc code") + +set(DETRAY_SETUP_VECMEM OFF CACHE BOOL "Do not set up VecMem as part of Detray") +set(DETRAY_SETUP_ALGEBRA_PLUGINS + OFF + CACHE BOOL + "Do not set up Algebra Plugins as part of Detray" +) +set(DETRAY_SETUP_GOOGLETEST + OFF + CACHE BOOL + "Do not set up GoogleTest as part of Detray" +) +set(DETRAY_SETUP_BENCHMARK + OFF + CACHE BOOL + "Do not set up Google Benchmark as part of Detray" +) +set(DETRAY_SETUP_THRUST ON CACHE BOOL "Set up Thrust as part of Detray") +set(DETRAY_SETUP_COVFIE OFF CACHE BOOL "Do not set up covfie as part of Detray") +set(DETRAY_SETUP_NLOHMANN + OFF + CACHE BOOL + "Do not set up Nlohmann as part of Detray" +) +set(DETRAY_SETUP_ACTSVG OFF CACHE BOOL "Do not set up Actsvg as part of Detray") +set(DETRAY_SETUP_DFELIBS + ON + CACHE BOOL + "Do not set up Dfelibs as part of Detray" +) +set(DETRAY_SVG_DISPLAY OFF CACHE BOOL "No not build the ActSVG display module") #Now set up its build. FetchContent_MakeAvailable(Detray) diff --git a/thirdparty/eigen3/CMakeLists.txt b/thirdparty/eigen3/CMakeLists.txt index 7aefc97f2bf..cd4fe4837c0 100644 --- a/thirdparty/eigen3/CMakeLists.txt +++ b/thirdparty/eigen3/CMakeLists.txt @@ -4,9 +4,15 @@ include(ExternalProject) set(Eigen3_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/eigen3-prefix/src/eigen3) -ExternalProject_Add(eigen3 "${ACTS_EIGEN3_SOURCE};CONFIGURE_COMMAND;;BUILD_COMMAND;;INSTALL_COMMAND;") +ExternalProject_Add( + eigen3 + "${ACTS_EIGEN3_SOURCE};CONFIGURE_COMMAND;;BUILD_COMMAND;;INSTALL_COMMAND;" +) add_library(Eigen3::Eigen INTERFACE IMPORTED GLOBAL) add_dependencies(Eigen3::Eigen eigen3) target_include_directories(Eigen3::Eigen INTERFACE ${Eigen3_INCLUDE_DIR}) -install(DIRECTORY ${Eigen3_INCLUDE_DIR}/Eigen DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install( + DIRECTORY ${Eigen3_INCLUDE_DIR}/Eigen + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/thirdparty/nlohmann_json/CMakeLists.txt b/thirdparty/nlohmann_json/CMakeLists.txt index f54653556b0..2e8be353c21 100644 --- a/thirdparty/nlohmann_json/CMakeLists.txt +++ b/thirdparty/nlohmann_json/CMakeLists.txt @@ -1,12 +1,12 @@ -include( FetchContent ) +include(FetchContent) # Tell the user what's happening. -message( STATUS "Building nlohmann_json as part of the ACTS project" ) +message(STATUS "Building nlohmann_json as part of the ACTS project") # Declare where to get nlohmann json from. -FetchContent_Declare( nlohmann_json ${ACTS_NLOHMANNJSON_SOURCE} ) +FetchContent_Declare(nlohmann_json ${ACTS_NLOHMANNJSON_SOURCE}) # Now set up its build. set(JSON_BuildTests OFF CACHE INTERNAL "") set(JSON_Install ON CACHE INTERNAL "") -FetchContent_MakeAvailable( nlohmann_json ) +FetchContent_MakeAvailable(nlohmann_json) diff --git a/thirdparty/pybind11/CMakeLists.txt b/thirdparty/pybind11/CMakeLists.txt index ac31675e057..525c56d6c80 100644 --- a/thirdparty/pybind11/CMakeLists.txt +++ b/thirdparty/pybind11/CMakeLists.txt @@ -1,12 +1,12 @@ -include( FetchContent ) +include(FetchContent) # Tell the user what's happening. -message( STATUS "Building pybind11 as part of the ACTS project" ) +message(STATUS "Building pybind11 as part of the ACTS project") # Declare where to get pybind from. -FetchContent_Declare( pybind11 ${ACTS_PYBIND11_SOURCE} ) +FetchContent_Declare(pybind11 ${ACTS_PYBIND11_SOURCE}) # Now set up its build. set(PYBIND11_TEST OFF) set(PYBIND11_INSTALL OFF) -FetchContent_MakeAvailable( pybind11 ) +FetchContent_MakeAvailable(pybind11) diff --git a/thirdparty/traccc/CMakeLists.txt b/thirdparty/traccc/CMakeLists.txt index a33636c9c8d..0cbf13838c9 100644 --- a/thirdparty/traccc/CMakeLists.txt +++ b/thirdparty/traccc/CMakeLists.txt @@ -10,50 +10,58 @@ include(FetchContent) # Tell the user what's happening. -message( STATUS "Building traccc as part of the Acts project" ) +message(STATUS "Building traccc as part of the Acts project") -set( TRACCC_VERSION "${_acts_traccc_version}") +set(TRACCC_VERSION "${_acts_traccc_version}") # Declare where to get traccc from. -FetchContent_Declare( - traccc - ${ACTS_TRACCC_SOURCE} -) +FetchContent_Declare(traccc ${ACTS_TRACCC_SOURCE}) if(ACTS_CUSTOM_SCALARTYPE) - set(ACTS_TRACCC_SCALARTYPE ${ACTS_CUSTOM_SCALARTYPE}) + set(ACTS_TRACCC_SCALARTYPE ${ACTS_CUSTOM_SCALARTYPE}) else() - set(ACTS_TRACCC_SCALARTYPE "double") + set(ACTS_TRACCC_SCALARTYPE "double") endif() -set( TRACCC_CUSTOM_SCALARTYPE "${ACTS_TRACCC_SCALARTYPE}" CACHE STRING - "Scalar type to use in the traccc code" ) - -set( TRACCC_SETUP_VECMEM OFF CACHE BOOL - "Do not set up Actsvg as part of Traccc" ) -set( TRACCC_SETUP_EIGEN3 OFF CACHE BOOL - "Do not set up Eigen3 as part of Traccc" ) -set( TRACCC_SETUP_THRUST ON CACHE BOOL - "Do not set up Thrust as part of Traccc" ) -set( TRACCC_SETUP_ALGEBRA_PLUGINS OFF CACHE BOOL - "Do not set up Algebra Plugins as part of Traccc" ) -set( TRACCC_SETUP_COVFIE OFF CACHE BOOL - "Do not set up Covfie as part of Traccc" ) -set( TRACCC_SETUP_DFELIBS OFF CACHE BOOL - "Do not set up dfelibs as part of Traccc" ) -set( TRACCC_SETUP_DETRAY ON CACHE BOOL - "Set up Detray as part of Traccc" ) -set( TRACCC_SETUP_ACTS OFF CACHE BOOL - "Do not set up ACTS as part of Traccc" ) -set( TRACCC_SETUP_TBB OFF CACHE BOOL - "Do not set up TBB as part of Traccc" ) - -set( TRACCC_BUILD_TESTING OFF CACHE BOOL - "Turn off the build of the Traccc unit tests" ) -set( TRACCC_BUILD_EXAMPLES OFF CACHE BOOL - "Turn off the build of the Traccc examples" ) -set (TRACCC_BUILD_BENCHMARKS OFF CACHE BOOL - "Turn off the build of the Traccc benchmarks") +set(TRACCC_CUSTOM_SCALARTYPE + "${ACTS_TRACCC_SCALARTYPE}" + CACHE STRING + "Scalar type to use in the traccc code" +) + +set(TRACCC_SETUP_VECMEM OFF CACHE BOOL "Do not set up Actsvg as part of Traccc") +set(TRACCC_SETUP_EIGEN3 OFF CACHE BOOL "Do not set up Eigen3 as part of Traccc") +set(TRACCC_SETUP_THRUST ON CACHE BOOL "Do not set up Thrust as part of Traccc") +set(TRACCC_SETUP_ALGEBRA_PLUGINS + OFF + CACHE BOOL + "Do not set up Algebra Plugins as part of Traccc" +) +set(TRACCC_SETUP_COVFIE OFF CACHE BOOL "Do not set up Covfie as part of Traccc") +set(TRACCC_SETUP_DFELIBS + OFF + CACHE BOOL + "Do not set up dfelibs as part of Traccc" +) +set(TRACCC_SETUP_DETRAY ON CACHE BOOL "Set up Detray as part of Traccc") +set(TRACCC_SETUP_ACTS OFF CACHE BOOL "Do not set up ACTS as part of Traccc") +set(TRACCC_SETUP_TBB OFF CACHE BOOL "Do not set up TBB as part of Traccc") + +set(TRACCC_BUILD_TESTING + OFF + CACHE BOOL + "Turn off the build of the Traccc unit tests" +) +set(TRACCC_BUILD_EXAMPLES + OFF + CACHE BOOL + "Turn off the build of the Traccc examples" +) +set(TRACCC_BUILD_BENCHMARKS + OFF + CACHE BOOL + "Turn off the build of the Traccc benchmarks" +) # Now set up its build. -FetchContent_MakeAvailable( traccc ) +FetchContent_MakeAvailable(traccc) diff --git a/thirdparty/vecmem/CMakeLists.txt b/thirdparty/vecmem/CMakeLists.txt index fca3f49572f..637ea1800b7 100644 --- a/thirdparty/vecmem/CMakeLists.txt +++ b/thirdparty/vecmem/CMakeLists.txt @@ -7,21 +7,27 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # CMake include(s). -include( FetchContent ) +include(FetchContent) # Tell the user what's happening. -message( STATUS "Building VecMem as part of the Acts project" ) +message(STATUS "Building VecMem as part of the Acts project") -set( VECMEM_VERSION "v${_acts_vecmem_version}") +set(VECMEM_VERSION "v${_acts_vecmem_version}") # Declare where to get VecMem from. -FetchContent_Declare( VecMem ${ACTS_VECMEM_SOURCE} ) +FetchContent_Declare(VecMem ${ACTS_VECMEM_SOURCE}) # Options used in the build of VecMem. -set( VECMEM_BUILD_TESTING FALSE CACHE BOOL - "Turn off the build of the VecMem unit tests" ) -set( VECMEM_BUILD_BENCHMARKING FALSE CACHE BOOL - "Turn off the build of VecMem benchmarking" ) +set(VECMEM_BUILD_TESTING + FALSE + CACHE BOOL + "Turn off the build of the VecMem unit tests" +) +set(VECMEM_BUILD_BENCHMARKING + FALSE + CACHE BOOL + "Turn off the build of VecMem benchmarking" +) # Now set up its build. -FetchContent_MakeAvailable( VecMem ) +FetchContent_MakeAvailable(VecMem) From d3df14095a7ec1d08528cdae5568d592f0314ed5 Mon Sep 17 00:00:00 2001 From: Jonah Zhu <43005040+Biblehome@users.noreply.github.com> Date: Mon, 19 Aug 2024 17:18:41 +0200 Subject: [PATCH 3/3] fix: add inline keyword to function PhotonConversion::generateChildren in PhotonConversion.hpp (#3516) A possibily missing inline keyword on PhotonConversion::generateChildren in PhotonConversion.hpp may lead to a multiple definition error from cmake. Add back this keyword. Co-authored-by: Andreas Stefl --- .../ActsFatras/Physics/ElectroMagnetic/PhotonConversion.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Fatras/include/ActsFatras/Physics/ElectroMagnetic/PhotonConversion.hpp b/Fatras/include/ActsFatras/Physics/ElectroMagnetic/PhotonConversion.hpp index 4e976f69882..6a01b08e19e 100644 --- a/Fatras/include/ActsFatras/Physics/ElectroMagnetic/PhotonConversion.hpp +++ b/Fatras/include/ActsFatras/Physics/ElectroMagnetic/PhotonConversion.hpp @@ -255,7 +255,7 @@ Particle::Vector3 PhotonConversion::generateChildDirection( return direction; } -std::array PhotonConversion::generateChildren( +inline std::array PhotonConversion::generateChildren( const Particle& photon, Scalar childEnergy, const Particle::Vector3& childDirection) const { using namespace Acts::UnitLiterals;