From 42f9285245d55e66df698d791e158acfd5508a9c Mon Sep 17 00:00:00 2001
From: lintao <lintao51@gmail.com>
Date: Sun, 26 Apr 2020 22:57:09 +0800
Subject: [PATCH] Migrate simulation.

---
 Simulation/DetSimAna/CMakeLists.txt       | 21 +++++++++++++++++----
 Simulation/DetSimCore/CMakeLists.txt      | 18 ++++++++++++++++--
 Simulation/DetSimGeom/CMakeLists.txt      | 12 ++++++++++--
 Simulation/DetSimInterface/CMakeLists.txt |  2 ++
 4 files changed, 45 insertions(+), 8 deletions(-)

diff --git a/Simulation/DetSimAna/CMakeLists.txt b/Simulation/DetSimAna/CMakeLists.txt
index 9ce97422..f1f36142 100644
--- a/Simulation/DetSimAna/CMakeLists.txt
+++ b/Simulation/DetSimAna/CMakeLists.txt
@@ -21,8 +21,21 @@ set(DetSimAna_srcs
 message("podio_LIBRARIES: ${podio_LIBRARIES}")
 message("plcio_LIBRARIES: ${plcio_LIBRARIES}")
 gaudi_add_module(DetSimAna ${DetSimAna_srcs}
-    INCLUDE_DIRS DetSimInterface FWCore DD4hep GaudiKernel Geant4 
-                 ${plcio_INCLUDE_DIRS} ${podio_INCLUDE_DIRS}
-    LINK_LIBRARIES DetSimInterface FWCore DD4hep ${DD4hep_COMPONENT_LIBRARIES} GaudiKernel Geant4
-                 ${plcio_LIBRARIES} ${podio_LIBRARIES}
+    INCLUDE_DIRS
+      # DetSimInterface
+      # FWCore
+      # DD4hep
+      # GaudiKernel
+      # Geant4 
+      # ${plcio_INCLUDE_DIRS}
+      # ${podio_INCLUDE_DIRS}
+    LINK_LIBRARIES
+      # DetSimInterface
+      # FWCore
+      DD4hep
+      ${DD4hep_COMPONENT_LIBRARIES} 
+      GaudiKernel
+      # Geant4
+      ${plcio_LIBRARIES} 
+      # ${podio_LIBRARIES}
 )
diff --git a/Simulation/DetSimCore/CMakeLists.txt b/Simulation/DetSimCore/CMakeLists.txt
index 95d56bc0..520ba3c5 100644
--- a/Simulation/DetSimCore/CMakeLists.txt
+++ b/Simulation/DetSimCore/CMakeLists.txt
@@ -10,6 +10,7 @@ find_package(Geant4 REQUIRED ui_all vis_all)
 include(${Geant4_USE_FILE})
 find_package(podio REQUIRED)
 find_package(plcio REQUIRED) 
+find_package(DD4hep COMPONENTS DDG4 REQUIRED)
 
 set(DetSimCore_srcs
     src/DetSimAlg.cpp
@@ -24,7 +25,20 @@ set(DetSimCore_srcs
     src/SteppingAction.cpp
 )
 
+message(" Geant4_LIBRARIES: ${Geant4_LIBRARIES}")
+
 gaudi_add_module(DetSimCore ${DetSimCore_srcs}
-    INCLUDE_DIRS DetSimInterface GaudiKernel Geant4 plcio ${plcio_INCLUDE_DIRS} ${podio_INCLUDE_DIRS}
-    LINK_LIBRARIES DetSimInterface GaudiKernel Geant4 plcio podio
+    INCLUDE_DIRS
+      # DetSimInterface
+      # GaudiKernel
+      # Geant4
+      # plcio ${plcio_INCLUDE_DIRS} ${podio_INCLUDE_DIRS}
+    LINK_LIBRARIES
+      DetSimInterface
+      GaudiKernel
+      # Geant4
+      # ${Geant4_LIBRARIES}
+      DD4hep ${DD4hep_COMPONENT_LIBRARIES} 
+      plcio
+      # podio
 )
diff --git a/Simulation/DetSimGeom/CMakeLists.txt b/Simulation/DetSimGeom/CMakeLists.txt
index fa2c4401..a3b5f324 100644
--- a/Simulation/DetSimGeom/CMakeLists.txt
+++ b/Simulation/DetSimGeom/CMakeLists.txt
@@ -16,6 +16,14 @@ set(DetSimGeom_srcs
 )
 
 gaudi_add_module(DetSimGeom ${DetSimGeom_srcs}
-    INCLUDE_DIRS DetSimInterface DetInterface DD4hep GaudiKernel Geant4
-    LINK_LIBRARIES DetSimInterface DD4hep ${DD4hep_COMPONENT_LIBRARIES} GaudiKernel Geant4
+    INCLUDE_DIRS
+    # DetSimInterface
+    # DetInterface
+    # DD4hep
+    # GaudiKernel
+    # Geant4
+    LINK_LIBRARIES
+      DD4hep ${DD4hep_COMPONENT_LIBRARIES} 
+      GaudiKernel 
+      # Geant4
 )
diff --git a/Simulation/DetSimInterface/CMakeLists.txt b/Simulation/DetSimInterface/CMakeLists.txt
index 1eec6f6e..8950d300 100644
--- a/Simulation/DetSimInterface/CMakeLists.txt
+++ b/Simulation/DetSimInterface/CMakeLists.txt
@@ -1,6 +1,8 @@
 
 gaudi_subdir(DetSimInterface v0r0)
 
+gaudi_depends_on_subdirs(GaudiKernel)
+
 # DetSimInterface (headers only)
 set(DetSimInterface_srcs
     src/IDetSimSvc.cpp
-- 
GitLab