Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if the CLHEP target exists before creating it #1169

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cmake/DD4hepBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,11 @@ MACRO(DD4HEP_SETUP_GEANT4_TARGETS)

if(Geant4_builtin_clhep_FOUND)
dd4hep_debug("Using Geant4 internal CLHEP")
ADD_LIBRARY(CLHEP::CLHEP INTERFACE IMPORTED GLOBAL)
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()
ADD_LIBRARY(CLHEP::CLHEP INTERFACE IMPORTED GLOBAL)
endif()
SET_TARGET_PROPERTIES(CLHEP::CLHEP
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Geant4_INCLUDE_DIRS}"
Expand Down
Loading