diff --git a/cmake/DD4hepBuild.cmake b/cmake/DD4hepBuild.cmake index ab12d75a7..add54c83a 100644 --- a/cmake/DD4hepBuild.cmake +++ b/cmake/DD4hepBuild.cmake @@ -826,7 +826,9 @@ MACRO(DD4HEP_SETUP_GEANT4_TARGETS) if(Geant4_builtin_clhep_FOUND) dd4hep_debug("Using Geant4 internal CLHEP") - ADD_LIBRARY(CLHEP::CLHEP INTERFACE IMPORTED GLOBAL) + IF(NOT TARGET CLHEP::CLHEP) + ADD_LIBRARY(CLHEP::CLHEP INTERFACE IMPORTED GLOBAL) + ENDIF() SET_TARGET_PROPERTIES(CLHEP::CLHEP PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Geant4_INCLUDE_DIRS}"