From 38f460cfa2ff88968efa833a1f475894346344fb Mon Sep 17 00:00:00 2001 From: Marco Clemencic <marco.clemencic@cern.ch> Date: Tue, 23 Jan 2024 12:54:18 +0100 Subject: [PATCH] Make GaudiPartProp optional --- CMakeLists.txt | 6 +++++- GaudiExamples/CMakeLists.txt | 18 ++++++++++++++---- GaudiPartProp/CMakeLists.txt | 4 ++++ ci-utils/preset-default.cmake | 1 + ci-utils/preset-full.cmake | 1 + ci-utils/preset-minimal.cmake | 1 + ci-utils/preset-no-AIDA.cmake | 1 + ci-utils/preset-no-GaudiAlg.cmake | 1 + ci-utils/preset-no-test.cmake | 1 + cmake/GaudiDependencies.cmake | 1 + 10 files changed, 30 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ad51c09ff..599f51c198 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,7 @@ after the configuration or use ccmake or cmake-gui. * GAUDI_GENCONF_NO_FAIL * Compile options * GAUDI_ENABLE_GAUDIALG + * GAUDI_ENABLE_GAUDIPARTPROP * GAUDI_REFLEX_COMPONENT_ALIASES * Doxygen * DOXYGEN_WITH_LOCAL_MATHJAX @@ -110,7 +111,10 @@ string(APPEND GAUDI_OPTIONAL_DEPENDENCIES "set(GAUDI_USE_PYTHON_MAJOR ${GAUDI_US list(PREPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules") # (Find*.cmake) include(cmake/GaudiDependencies.cmake) -string(APPEND GAUDI_OPTIONAL_DEPENDENCIES "set(GAUDI_ENABLE_GAUDIALG ${GAUDI_ENABLE_GAUDIALG})\n") +string(APPEND GAUDI_OPTIONAL_DEPENDENCIES " +set(GAUDI_ENABLE_GAUDIALG ${GAUDI_ENABLE_GAUDIALG}) +set(GAUDI_ENABLE_GAUDIPARTPROP ${GAUDI_ENABLE_GAUDIPARTPROP}) +") # The C++ standard used must be the same as ROOT's if(NOT GAUDI_CXX_STANDARD) diff --git a/GaudiExamples/CMakeLists.txt b/GaudiExamples/CMakeLists.txt index ffe6d9797a..cd8c22d862 100644 --- a/GaudiExamples/CMakeLists.txt +++ b/GaudiExamples/CMakeLists.txt @@ -76,7 +76,6 @@ gaudi_add_module(GaudiExamples src/NTuples/NTupleAlgorithm.cpp src/PluginService/BackwardCompatibleAliases.cpp src/PluginService/SpecialCustomFactory.cpp - src/PartProp/PartPropAlg.cpp src/Properties/CustomPropertiesAlg.cpp src/Properties/PropertyAlg.cpp src/Properties/PropertyProxy.cpp @@ -101,7 +100,6 @@ gaudi_add_module(GaudiExamples Gaudi::Functional GaudiUtilsLib GaudiExamplesLib - GaudiPartProp ROOT::Tree ROOT::RIO ROOT::Hist @@ -129,8 +127,7 @@ if(GAUDI_USE_AIDA) target_link_libraries(GaudiExamples PRIVATE AIDA::aida) endif() if(GAUDI_USE_HEPPDT) - target_sources(GaudiExamples PRIVATE src/PartProp/GaudiPPS.cpp - src/PartProp/PartPropExa.cpp) + target_sources(GaudiExamples PRIVATE src/PartProp/PartPropExa.cpp) target_link_libraries(GaudiExamples PRIVATE HepPDT::heppdt) endif() if(TARGET RootCnvLib) @@ -139,6 +136,13 @@ if(TARGET RootCnvLib) src/MultiInput/MIWriteAlg.cpp) target_link_libraries(GaudiExamples PRIVATE RootCnvLib) endif() +if(GAUDI_ENABLE_GAUDIPARTPROP) + target_sources(GaudiExamples PRIVATE + src/PartProp/GaudiPPS.cpp + src/PartProp/PartPropAlg.cpp + ) + target_link_libraries(GaudiExamples PRIVATE Gaudi::GaudiPartProp) +endif() # Build the executable gaudi_add_executable(Allocator @@ -190,6 +194,12 @@ if(BUILD_TESTING) PROPERTIES DISABLED TRUE ) endif() + if(NOT GAUDI_ENABLE_GAUDIPARTPROP) + set_tests_properties( + GaudiExamples.particlepropsvc + PROPERTIES DISABLED TRUE + ) + endif() endif() gaudi_add_pytest(tests/pytest) diff --git a/GaudiPartProp/CMakeLists.txt b/GaudiPartProp/CMakeLists.txt index 899e2a73a4..3aad2a4c15 100644 --- a/GaudiPartProp/CMakeLists.txt +++ b/GaudiPartProp/CMakeLists.txt @@ -10,6 +10,10 @@ ##################################################################################### # GaudiPartProp subdirectory +if(NOT GAUDI_ENABLE_GAUDIPARTPROP) + return() +endif() + gaudi_add_library(GaudiPartProp SOURCES src/CC.cpp diff --git a/ci-utils/preset-default.cmake b/ci-utils/preset-default.cmake index c42425255b..145c7e8100 100644 --- a/ci-utils/preset-default.cmake +++ b/ci-utils/preset-default.cmake @@ -10,4 +10,5 @@ # set(GAUDI_USE_INTELAMPLIFIER OFF CACHE BOOL "") # set(GAUDI_USE_JEMALLOC ON CACHE BOOL "") # set(GAUDI_ENABLE_GAUDIALG OFF CACHE BOOL "") +# set(GAUDI_ENABLE_GAUDIPARTPROP ON CACHE BOOL "") # set(BUILD_TESTING ON CACHE BOOL "") diff --git a/ci-utils/preset-full.cmake b/ci-utils/preset-full.cmake index 98ccb053a5..6c7c58d008 100644 --- a/ci-utils/preset-full.cmake +++ b/ci-utils/preset-full.cmake @@ -10,4 +10,5 @@ set(GAUDI_USE_DOXYGEN ON CACHE BOOL "") set(GAUDI_USE_INTELAMPLIFIER ON CACHE BOOL "") set(GAUDI_USE_JEMALLOC ON CACHE BOOL "") set(GAUDI_ENABLE_GAUDIALG ON CACHE BOOL "") +set(GAUDI_ENABLE_GAUDIPARTPROP ON CACHE BOOL "") set(BUILD_TESTING ON CACHE BOOL "") diff --git a/ci-utils/preset-minimal.cmake b/ci-utils/preset-minimal.cmake index 8a58d67413..dd8e50d074 100644 --- a/ci-utils/preset-minimal.cmake +++ b/ci-utils/preset-minimal.cmake @@ -10,4 +10,5 @@ set(GAUDI_USE_DOXYGEN OFF CACHE BOOL "") set(GAUDI_USE_INTELAMPLIFIER OFF CACHE BOOL "") set(GAUDI_USE_JEMALLOC OFF CACHE BOOL "") set(GAUDI_ENABLE_GAUDIALG OFF CACHE BOOL "") +set(GAUDI_ENABLE_GAUDIPARTPROP OFF CACHE BOOL "") set(BUILD_TESTING OFF CACHE BOOL "") diff --git a/ci-utils/preset-no-AIDA.cmake b/ci-utils/preset-no-AIDA.cmake index 756ecda66f..bffb634160 100644 --- a/ci-utils/preset-no-AIDA.cmake +++ b/ci-utils/preset-no-AIDA.cmake @@ -10,4 +10,5 @@ set(GAUDI_USE_DOXYGEN ON CACHE BOOL "") set(GAUDI_USE_INTELAMPLIFIER ON CACHE BOOL "") set(GAUDI_USE_JEMALLOC ON CACHE BOOL "") set(GAUDI_ENABLE_GAUDIALG OFF CACHE BOOL "") +set(GAUDI_ENABLE_GAUDIPARTPROP ON CACHE BOOL "") set(BUILD_TESTING ON CACHE BOOL "") diff --git a/ci-utils/preset-no-GaudiAlg.cmake b/ci-utils/preset-no-GaudiAlg.cmake index 0bb4368355..e3c5668a64 100644 --- a/ci-utils/preset-no-GaudiAlg.cmake +++ b/ci-utils/preset-no-GaudiAlg.cmake @@ -10,4 +10,5 @@ set(GAUDI_USE_DOXYGEN ON CACHE BOOL "") set(GAUDI_USE_INTELAMPLIFIER ON CACHE BOOL "") set(GAUDI_USE_JEMALLOC ON CACHE BOOL "") set(GAUDI_ENABLE_GAUDIALG OFF CACHE BOOL "") +set(GAUDI_ENABLE_GAUDIPARTPROP ON CACHE BOOL "") set(BUILD_TESTING ON CACHE BOOL "") diff --git a/ci-utils/preset-no-test.cmake b/ci-utils/preset-no-test.cmake index 81f183cf90..f31bf21593 100644 --- a/ci-utils/preset-no-test.cmake +++ b/ci-utils/preset-no-test.cmake @@ -10,4 +10,5 @@ # set(GAUDI_USE_INTELAMPLIFIER OFF CACHE BOOL "") # set(GAUDI_USE_JEMALLOC ON CACHE BOOL "") # set(GAUDI_ENABLE_GAUDIALG OFF CACHE BOOL "") +# set(GAUDI_ENABLE_GAUDIPARTPROP ON CACHE BOOL "") set(BUILD_TESTING OFF CACHE BOOL "") diff --git a/cmake/GaudiDependencies.cmake b/cmake/GaudiDependencies.cmake index cc39608902..82a529f7b0 100644 --- a/cmake/GaudiDependencies.cmake +++ b/cmake/GaudiDependencies.cmake @@ -139,6 +139,7 @@ endif() set(gperftools_pkgconfig_module "libprofiler>=2.7.0") option(GAUDI_ENABLE_GAUDIALG "Build the subdirectory GaudiAlg" NO) +option(GAUDI_ENABLE_GAUDIPARTPROP "Build the subdirectory GaudiPartProp" YES) foreach(dep IN LISTS deps) string(TOUPPER ${dep} DEP) -- GitLab