From 0a76a7fe4b39d1f1a2bfa99e179c755f3d8d440d Mon Sep 17 00:00:00 2001
From: Markus Frank <Markus.Frank@cern.ch>
Date: Sun, 30 Oct 2022 10:40:46 +0100
Subject: [PATCH] Address issue https://github.com/AIDASoft/DD4hep/issues/999
---
DDDigi/CMakeLists.txt | 34 ++++++++++++++---------------
examples/ClientTests/CMakeLists.txt | 15 ++++++++-----
2 files changed, 26 insertions(+), 23 deletions(-)
diff --git a/DDDigi/CMakeLists.txt b/DDDigi/CMakeLists.txt
index e7a4e3803..151afca05 100644
--- a/DDDigi/CMakeLists.txt
+++ b/DDDigi/CMakeLists.txt
@@ -22,8 +22,8 @@ target_include_directories(DDDigi
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
- )
-
+)
+#
if(DD4HEP_USE_TBB)
dd4hep_print( "|++> TBB_IMPORTED_TARGETS --> ${TBB_IMPORTED_TARGETS}")
dd4hep_print( "|++> TBB found. DDDigi will run multi threaded.")
@@ -32,45 +32,45 @@ if(DD4HEP_USE_TBB)
else()
dd4hep_print( "|++> TBB not used. DDDigi will only work single threaded.")
endif()
-
+#
#--------------------------- Legacy libraries -------------------------------------
dd4hep_add_dictionary(G__DDDigi
SOURCES ../DDCore/include/ROOT/Warnings.h python/DDDigiDict.C
LINKDEF ../DDCore/include/ROOT/LinkDef.h
USES DD4hep::DDCore ROOT::Core ROOT::Geom ROOT::GenVector ROOT::RIO Boost::boost
- )
+)
#--------------------------- Plugin library for the digitization framework -------
dd4hep_add_plugin(DDDigiPlugins
SOURCES plugins/*.cpp
GENERATED G__DDDigi.cxx
USES DD4hep::DDDigi
- )
-
+)
#--------------------------- Plugin library to read input from DDG4 --------------
if (DD4HEP_USE_GEANT4)
dd4hep_add_dictionary(G__DDDigi_DDG4_IO
SOURCES ../DDCore/include/ROOT/Warnings.h ddg4/IO.cpp
LINKDEF ../DDCore/include/ROOT/LinkDef.h
USES DD4hep::DDG4 DD4hep::DDCore
- )
-
+ )
dd4hep_add_plugin(DDDigi_DDG4_IO
SOURCES ddg4/*.cpp
GENERATED G__DDDigi_DDG4_IO.cxx
USES DD4hep::DDDigi DD4hep::DDG4 DD4hep::DDCore
- )
+ )
+ set_target_properties(DDDigi_DDG4_IO PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION})
+ install(TARGETS DDDigi_DDG4_IO EXPORT DD4hep ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
else()
dd4hep_print( "|++> Geant4 not used. DDDigi will not be able to read DDG4 output.")
endif()
-
+#
#---Package installation procedure(s) ----------------------------------------------
-
-set_target_properties(DDDigi DDDigiPlugins DDDigi_DDG4_IO PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION})
-
-file(GLOB DDigi_python python/*.py python/*.C)
-install(FILES ${DDigi_python} DESTINATION ${DD4HEP_PYTHON_INSTALL_DIR})
-install(TARGETS DDDigi DDDigiPlugins DDDigi_DDG4_IO EXPORT DD4hep
+set_target_properties(DDDigi DDDigiPlugins PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION})
+#
+file(GLOB DDDigi_python python/*.py python/*.C)
+install(FILES ${DDDigi_python} DESTINATION ${DD4HEP_PYTHON_INSTALL_DIR})
+#
+install(TARGETS DDDigi DDDigiPlugins EXPORT DD4hep
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
- )
+)
install(DIRECTORY include/DDDigi DESTINATION include)
diff --git a/examples/ClientTests/CMakeLists.txt b/examples/ClientTests/CMakeLists.txt
index 6d2a6fc43..3f0c7dc07 100644
--- a/examples/ClientTests/CMakeLists.txt
+++ b/examples/ClientTests/CMakeLists.txt
@@ -213,13 +213,16 @@ if( ${ROOT_VERSION} VERSION_GREATER 6.21.00 )
else()
message(STATUS "++ ROOT version: ${ROOT_VERSION} ... NO version specific tests for ROOT>6.21...")
endif()
-if( ${Geant4_VERSION} VERSION_GREATER 10.2.99 )
- # message(STATUS "++ Geant4 version: ${Geant4_VERSION} ... adding tests...")
- list(APPEND ClientTests_ShapeTests Scaled_Cone)
-else()
- message(STATUS "++ Geant4 version: ${Geant4_VERSION} ... NO version specific tests for G4>=10.3...")
+#
+if (DD4HEP_USE_GEANT4)
+ if( ${Geant4_VERSION} VERSION_GREATER 10.2.99 )
+ # message(STATUS "++ Geant4 version: ${Geant4_VERSION} ... adding tests...")
+ list(APPEND ClientTests_ShapeTests Scaled_Cone)
+ else()
+ message(STATUS "++ Geant4 version: ${Geant4_VERSION} ... NO version specific tests for G4>=10.3...")
+ endif()
endif()
-
+#
foreach (test ${ClientTests_ShapeTests})
dd4hep_add_test_reg( ClientTests_Check_Shape_${test}
COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh"
--
GitLab