From 7efc76b5c5eccd7a56802446f607833e92d863fe Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Tue, 6 Dec 2022 16:39:51 +0100 Subject: [PATCH] improve dd4hep cmake flags --- dd4hep.spec | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/dd4hep.spec b/dd4hep.spec index 0a3f9cac8ff..aa36502b081 100644 --- a/dd4hep.spec +++ b/dd4hep.spec @@ -9,6 +9,18 @@ Source: git+https://github.com/%{github_user}/DD4hep.git?obj=%{branch}/%{tag}&ex BuildRequires: cmake Requires: root boost clhep xerces-c geant4 +%define cmake_fixed_args \\\ + -DCMAKE_INSTALL_PREFIX='%{i}' \\\ + -DBoost_NO_BOOST_CMAKE=ON \\\ + -DDD4HEP_USE_XERCESC=ON \\\ + -DDD4HEP_USE_PYROOT=ON \\\ + -DCMAKE_CXX_STANDARD=17 \\\ + -DCMAKE_BUILD_TYPE=Release \\\ + -DCMAKE_CXX_FLAGS_RELEASE='-O2 -DNDEBUG' \\\ + -DDD4HEP_USE_GEANT4_UNITS=ON \\\ + -DXERCESC_ROOT_DIR=${XERCES_C_ROOT} \\\ + -DCMAKE_PREFIX_PATH="${CLHEP_ROOT};${XERCES_C_ROOT}" + %prep %setup -n %{n}-%{realversion} @@ -16,26 +28,16 @@ Requires: root boost clhep xerces-c geant4 %build export BOOST_ROOT -CMAKE_ARGS="-DCMAKE_INSTALL_PREFIX='%{i}' \ - -DBoost_NO_BOOST_CMAKE=ON \ - -DDD4HEP_USE_XERCESC=ON \ - -DXERCESC_ROOT_DIR=${XERCES_C_ROOT} \ - -DDD4HEP_USE_PYROOT=ON \ - -DCMAKE_CXX_STANDARD=17 \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_FLAGS_RELEASE="-O2 -DNDEBUG" \ - -DDD4HEP_USE_GEANT4_UNITS=ON \ - -DCMAKE_PREFIX_PATH=${CLHEP_ROOT};${XERCES_C_ROOT}" #Build normal Shared D4Hep without Geant4 rm -rf ../build; mkdir ../build; cd ../build -cmake $CMAKE_ARGS -DBUILD_SHARED_LIBS=ON ../%{n}-%{realversion} +cmake %{cmake_fixed_args} -DBUILD_SHARED_LIBS=ON ../%{n}-%{realversion} make %{makeprocesses} VERBOSE=1 make install #Building DDG4 static rm -rf ../build-g4; mkdir ../build-g4; cd ../build-g4 -cmake $CMAKE_ARGS -DBUILD_SHARED_LIBS=OFF -DDD4HEP_USE_GEANT4=ON ../%{n}-%{realversion} +cmake %{cmake_fixed_args} -DBUILD_SHARED_LIBS=OFF -DDD4HEP_USE_GEANT4=ON ../%{n}-%{realversion} cd DDG4 make %{makeprocesses} VERBOSE=1 for lib in $(ls ../lib/libDDG4*.a | sed 's|.a$||'); do