diff --git a/DDG4/CMakeLists.txt b/DDG4/CMakeLists.txt index bffb2ced1b175d9cddd79c3624b52b26ded79124..0f77486effb74c16f5729e4f4cf92c9aaa9b084c 100644 --- a/DDG4/CMakeLists.txt +++ b/DDG4/CMakeLists.txt @@ -57,7 +57,7 @@ new_dd4hep_add_dictionary( G__DDG4 new_dd4hep_add_plugin(DDG4Plugins SOURCES plugins/*.cpp GENERATED G__DDG4.cxx - LINK_LIBRARIES ROOT::Core CLHEP::CLHEP DDG4 ${XML_LIBRARIES} DDParsers + LINK_LIBRARIES ROOT::Core ${CLHEP} DDG4 ${XML_LIBRARIES} DDParsers ) #--------------------------- Plugin library for the simulation framework --------- @@ -85,7 +85,9 @@ if(PYTHONLIBS_FOUND) #---Helper to overcome deficiency of the python executable concerning multi-threading add_executable(pyddg4 pyddg4.cpp) target_link_libraries(pyddg4 PUBLIC DDPython ROOT::Core ROOT::PyROOT) - INSTALL(TARGETS DDPython EXPORT DD4hep DESTINATION lib) + INSTALL(TARGETS DDPython pyddg4 EXPORT DD4hep + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin) endif() else() MESSAGE(STATUS "Python not found, not creating DDG4 4Python Dictionaries") @@ -93,7 +95,7 @@ endif() #--------------------------- Plugin library for the simulation framework --------- #--------------------------- LCIO Plugins for new simulation framework ----------- -IF(DD4HEP_USE_LCIO) +IF(TARGET LCIO::LCIO) new_dd4hep_add_plugin(DDG4LCIO SOURCES lcio/*.cpp LINK_LIBRARIES DDG4 LCIO::LCIO diff --git a/cmake/DD4hepBuild.cmake b/cmake/DD4hepBuild.cmake index 777329c1caab0a3ac87c4f09dc406a623d51666a..f27716e65bdbd85298edb888d6ce574d5a321778 100644 --- a/cmake/DD4hepBuild.cmake +++ b/cmake/DD4hepBuild.cmake @@ -1685,6 +1685,7 @@ ENDMACRO() MACRO(DD4HEP_SETUP_GEANT4_TARGETS) + # only do this once IF(NOT TARGET Geant4::Interface) #include( ${Geant4_USE_FILE} ) # do not use the use file, this is not very considerate... @@ -1692,12 +1693,18 @@ MACRO(DD4HEP_SETUP_GEANT4_TARGETS) MESSAGE(FATAL_ERROR "Geant4 was built with ${Geant4_TLS_MODEL}, DD4hep requires 'global-dynamic'! Ignore this ERROR with DD4HEP_IGNORE_GEANT4_TLS=True ") ENDIF() - # if(Geant4_builtin_clhep_FOUND) - # set(CLHEP "") - # else() - # FIND_PACKAGE(CLHEP REQUIRED) - # set(CLHEP CLHEP) - # endif() + if(Geant4_builtin_clhep_FOUND) + MESSAGE("STATUS: Using Geant4 internal CLHEP") + set(CLHEP "") + else() + FIND_PACKAGE(CLHEP REQUIRED) + set(CLHEP CLHEP::CLHEP) + MESSAGE("STATUS: Using External CLHEP") + MESSAGE(STATUS "CLHEP Libraries ${CLHEP_LIBRARIES}") + MESSAGE(STATUS "CLHEP CXX_FLAGS ${CLHEP_CXX_FLAGS}") + MESSAGE(STATUS "CLHEP INCL DIRS ${CLHEP_INCLUDE_DIRS}") + MESSAGE(STATUS "CLHEP_VERSION: ${CLHEP_VERSION}" ) + endif() MESSAGE(STATUS "Geant4 Libraries ${Geant4_LIBRARIES}") MESSAGE(STATUS "Geant4 CXX_FLAGS ${Geant4_CXX_FLAGS}") diff --git a/examples/LHeD/CMakeLists.txt b/examples/LHeD/CMakeLists.txt index 262ff92a8467196ca38c1439d0165361fd7fb456..6a977ef94761b63f524f185bb593913dee9055f6 100644 --- a/examples/LHeD/CMakeLists.txt +++ b/examples/LHeD/CMakeLists.txt @@ -35,13 +35,12 @@ if (DD4HEP_USE_GEANT4) #-------------------------------------------------------------------------- add_executable(LHeDACLick scripts/LHeDACLick.C) target_link_libraries(LHeDACLick DD4hep::DDCore DD4hep::DDG4 Geant4::Interface) + INSTALL(TARGETS LHeDXML LHeDACLick LHeD + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ) endif() - -INSTALL(TARGETS LHeDXML LHeDACLick LHeD - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ) # dd4hep_configure_scripts(LHeD DEFAULT_SETUP WITH_TESTS) # @@ -88,7 +87,6 @@ if (DD4HEP_USE_GEANT4) dd4hep_add_test_reg( LHeD_DDG4_${script}_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh" EXEC_ARGS python ${LHeDEx_INSTALL}/scripts/${script}.py - REQUIRES DDG4 Geant4 REGEX_PASS "TEST_PASSED" REGEX_FAIL "Exception;EXCEPTION;ERROR" ) endforeach(script) @@ -99,7 +97,6 @@ if (DD4HEP_USE_GEANT4) EXEC_ARGS python ${DD4hep_DIR}/python/g4MaterialScan.py --compact=file:${LHeDEx_INSTALL}/compact/compact.xml "--position=0,0,0" "--direction=0,1,0" - REQUIRES DDG4 Geant4 REGEX_PASS " Terminate Geant4 and delete associated actions." ) # # Geant4 simulations with initialization using ACLick and XMl @@ -109,7 +106,6 @@ if (DD4HEP_USE_GEANT4) dd4hep_add_test_reg( LHeD_DDG4_${script}_as_ACLick_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh" EXEC_ARGS root.exe -b -x -n -q -l "${LHeDEx_INSTALL}/scripts/run.C(\"${LHeDEx_INSTALL}/scripts/${script}\")" - REQUIRES DDG4 Geant4 REGEX_PASS "UserEvent_1 INFO Geant4TestEventAction> calling end.event_id=9" REGEX_FAIL "Exception;EXCEPTION;ERROR;Error" ) # @@ -117,7 +113,6 @@ if (DD4HEP_USE_GEANT4) dd4hep_add_test_reg( LHeD_DDG4_${script}_as_exe_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh" EXEC_ARGS ${script} - REQUIRES DDG4 Geant4 REGEX_PASS "UserEvent_1 INFO Geant4TestEventAction> calling end.event_id=9" REGEX_FAIL "Exception;EXCEPTION;ERROR;Error" ) endforeach(script)