From c501beeeee5bdbcfe76a4a9881a6626be61f8800 Mon Sep 17 00:00:00 2001
From: lintao <lintao51@gmail.com>
Date: Wed, 23 Dec 2020 15:23:10 +0800
Subject: [PATCH] WIP: migrate DCHDedx.

---
 CMakeLists.txt                        |  2 +-
 Reconstruction/CMakeLists.txt         |  5 ++++
 Reconstruction/DCHDedx/CMakeLists.txt | 35 ++++++++++++++-------------
 3 files changed, 24 insertions(+), 18 deletions(-)
 create mode 100644 Reconstruction/CMakeLists.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8ff8cbce..dde64073 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,7 +28,7 @@ add_subdirectory(Detector)
 add_subdirectory(Digitisers)
 add_subdirectory(Examples)
 add_subdirectory(Generator)
-# add_subdirectory(Reconstruction)
+add_subdirectory(Reconstruction)
 add_subdirectory(Service)
 add_subdirectory(Simulation)
 add_subdirectory(Utilities)
diff --git a/Reconstruction/CMakeLists.txt b/Reconstruction/CMakeLists.txt
new file mode 100644
index 00000000..0cbb231c
--- /dev/null
+++ b/Reconstruction/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_subdirectory(DCHDedx)
+# add_subdirectory(Digi_Calo)
+# add_subdirectory(PFA)
+# add_subdirectory(SiliconTracking)
+# add_subdirectory(Tracking)
diff --git a/Reconstruction/DCHDedx/CMakeLists.txt b/Reconstruction/DCHDedx/CMakeLists.txt
index 31673639..9d1fd08f 100644
--- a/Reconstruction/DCHDedx/CMakeLists.txt
+++ b/Reconstruction/DCHDedx/CMakeLists.txt
@@ -1,26 +1,27 @@
-gaudi_subdir(DCHDedx v0r0)
 
+find_package(k4FWCore)
 find_package(EDM4HEP REQUIRED ) 
 find_package(DD4hep COMPONENTS DDCore DDRec REQUIRED)
 
-
-gaudi_depends_on_subdirs(
-    k4FWCore
-    Simulation/DetSimInterface
-    Detector/DetInterface
-    Detector/DetSegmentation
-)
-
 set(srcs
-    src/*.cpp
+    src/RecDCHDedxAlg.cpp
 )
 
 # Modules
-gaudi_add_module(DCHDedx ${srcs}
-    INCLUDE_DIRS GaudiKernel 
-    LINK_LIBRARIES GaudiAlgLib GaudiKernel 
-    DetSegmentation
-      -Wl,--no-as-needed
-     EDM4HEP::edm4hep EDM4HEP::edm4hepDict
-     -Wl,--as-needed
+gaudi_add_module(DCHDedx
+                 SOURCES ${srcs}
+                 LINK DetSimInterface
+                      DetInterface
+                      DetSegmentation
+                      k4FWCore::k4FWCore
+                      Gaudi::GaudiAlgLib 
+                      Gaudi::GaudiKernel 
+                      DetSegmentation
+                      EDM4HEP::edm4hep EDM4HEP::edm4hepDict
 )
+
+install(TARGETS DCHDedx
+  EXPORT CEPCSWTargets
+  RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin
+  LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib
+  COMPONENT dev)
-- 
GitLab