From 63102174324d2e94f4570c261b2f6c7b35de2ffb Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Tue, 19 Nov 2024 09:39:02 +0100 Subject: [PATCH] CMake: fix using Geant4 internal clhep the target is now(?) prefixed with Geant4:: otherwise we get a linking error --- cmake/DD4hepBuild.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/DD4hepBuild.cmake b/cmake/DD4hepBuild.cmake index d28959a48..bf53ed204 100644 --- a/cmake/DD4hepBuild.cmake +++ b/cmake/DD4hepBuild.cmake @@ -843,7 +843,11 @@ MACRO(DD4HEP_SETUP_GEANT4_TARGETS) PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Geant4_INCLUDE_DIRS}" ) - TARGET_LINK_LIBRARIES(CLHEP::CLHEP INTERFACE G4clhep) + if(TARGET Geant4::G4clhep) + TARGET_LINK_LIBRARIES(CLHEP::CLHEP INTERFACE Geant4::G4clhep) + else() + TARGET_LINK_LIBRARIES(CLHEP::CLHEP INTERFACE G4clhep) + endif() else() IF(NOT TARGET CLHEP::CLHEP)