Skip to content

Commit

Permalink
Spit out a warning if CLHEP::CLHEP the target already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Sep 15, 2023
1 parent 8e9f5d1 commit 92364aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmake/DD4hepBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -826,9 +826,11 @@ MACRO(DD4HEP_SETUP_GEANT4_TARGETS)

if(Geant4_builtin_clhep_FOUND)
dd4hep_debug("Using Geant4 internal CLHEP")
IF(NOT TARGET CLHEP::CLHEP)
if(TARGET CLHEP::CLHEP)
message(WARNING "CLHEP::CLHEP already exists, this may cause problems if there are two different installations of CLHEP, one from Geant4 and one external")
else if(NOT TARGET CLHEP::CLHEP)
ADD_LIBRARY(CLHEP::CLHEP INTERFACE IMPORTED GLOBAL)
ENDIF()
endif()
SET_TARGET_PROPERTIES(CLHEP::CLHEP
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Geant4_INCLUDE_DIRS}"
Expand Down

0 comments on commit 92364aa

Please sign in to comment.