Skip to content

Commit 5ba94b4

Browse files
sawenzelclaude
andcommitted
Allow Geant4 to be found more than once
This lets FindGeant4 return early when its targets already exist. - A geant4_vmc built with G4HepEm finds G4HepEm, which finds Geant4 again. - FindGeant4 then failed because the geant4 target already existed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent f31d614 commit 5ba94b4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎dependencies/FindGeant4.cmake‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ if(NOT Geant4_FOUND)
1717
return()
1818
endif()
1919

20+
# already set up, eg. when found again as a dependency of G4HepEm
21+
if(TARGET geant4)
22+
return()
23+
endif()
24+
2025
add_library(geant4 IMPORTED INTERFACE)
2126

2227
set_target_properties(geant4

0 commit comments

Comments
 (0)