From e570341c08dfc8c5099a32c0f62c9530eb4ce7e1 Mon Sep 17 00:00:00 2001
From: "Joseph F. Boudreau" <boudreau@pitt.edu>
Date: Fri, 23 Dec 2022 05:39:11 -0500
Subject: [PATCH] This is a bugfix:  the pythia dependency of fullSimLight is
 declared before the target (fullSimLight) has been delclared

---
 FullSimLight/CMakeLists.txt | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/FullSimLight/CMakeLists.txt b/FullSimLight/CMakeLists.txt
index 124e53afc..5262a85d5 100644
--- a/FullSimLight/CMakeLists.txt
+++ b/FullSimLight/CMakeLists.txt
@@ -57,12 +57,6 @@ find_package(Geant4 REQUIRED)
 message( STATUS "Found Geant4: ${Geant4_INCLUDE_DIR}")
 #----------------------------------------------------------------------------
 
-# Support for the Pythia MC generator
-find_package(Pythia QUIET) # optional
-if(Pythia_FOUND)
-  target_compile_definitions(fullSimLight PRIVATE USE_PYTHIA)
-  target_link_libraries(fullSimLight PRIVATE Pythia::Pythia)
-endif()
 
 # Support for the HepMC3 exchange format
 # This is ON by default, but it can be disabled by the user if not used/needed,
@@ -145,6 +139,14 @@ add_executable(gmgeantino geantinoMaps.cc ${sources} ${headers})
 add_executable(gm2gdml geoModel2GDML.cc ${sources} ${headers})
 
 
+# Support for the Pythia MC generator
+find_package(Pythia QUIET) # optional
+if(Pythia_FOUND)
+  target_compile_definitions(fullSimLight PRIVATE USE_PYTHIA)
+  target_link_libraries(fullSimLight PRIVATE Pythia::Pythia)
+endif()
+
+
 
 #if(HEPMC3_ROOTIO_USE)
 #  message( STATUS "HEPMC3 Root Dependency Switched on")
-- 
GitLab