From 0c3e704b35a6cdab9e5ff5afdda40999ca1abff8 Mon Sep 17 00:00:00 2001
From: Chao Peng <thor1009@gmail.com>
Date: Mon, 18 Nov 2019 22:41:56 -0600
Subject: [PATCH] update cmakelist to include et library

---
 CMakeLists.txt     | 4 ++++
 src/CMakeLists.txt | 7 ++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 66a0893..31d4d8a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,7 @@ project(hcana VERSION 0.95 LANGUAGES CXX)
 option(HCANA_BUILTIN_PODD "Use built-in Podd submodule (default: YES)" OFF)
 
 include(cmake/os.cmake)
+include(FindThreads)
 
 find_package(ROOT 6.0 REQUIRED CONFIG)
 include(${ROOT_USE_FILE})
@@ -23,6 +24,9 @@ else()
   get_target_property(SPDLOG_INCLUDE_DIR spdlog::spdlog INTERFACE_INCLUDE_DIRECTORIES)
 endif()
 
+find_package(coda_et REQUIRED)
+get_target_property(CODA_ET_INCLUDE_DIR coda_et::coda_et INTERFACE_INCLUDE_DIRECTORIES)
+
 #----------------------------------------------------------------------------
 # Set up Podd and ROOT dependencies
 if(HCANA_BUILTIN_PODD)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2c5c730..e5a3eba 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.5)
 # Names of the main items we build here
 set(LIBNAME HallC)
 set(EXENAME hcana)
+include(FindThreads)
 
 #----------------------------------------------------------------------------
 # Sources and headers
@@ -65,7 +66,7 @@ target_include_directories(${LIBNAME}
     $<BUILD_INTERFACE:${SPDLOG_INCLUDE_DIR}>
     $<INSTALL_INTERFACE:${SPDLOG_INCLUDE_DIR}>
     $<BUILD_INTERFACE:${FMT_INCLUDE_DIR}>
-    /site/coda/3.10/Linux-x86_64/include
+    $<BUILD_INTERFACE:${CODA_ET_INCLUDE_DIR}>
   )
 
 target_compile_options(${LIBNAME}
@@ -87,7 +88,7 @@ target_link_libraries(${LIBNAME}
   PUBLIC
     Podd::Podd
     Podd::Decode
-    et
+    coda_et::coda_et
   )
 set_target_properties(${LIBNAME} PROPERTIES
   SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
@@ -113,12 +114,12 @@ build_root_dictionary(${LIBNAME} ${headers}
   INCLUDEDIRS 
   $<BUILD_INTERFACE:-I${SPDLOG_INCLUDE_DIR}>
   $<BUILD_INTERFACE:-I${FMT_INCLUDE_DIR}>
+  $<BUILD_INTERFACE:-I${CODA_ET_INCLUDE_DIR}>
   -I${CMAKE_CURRENT_SOURCE_DIR} 
   -I${CMAKE_CURRENT_SOURCE_DIR}/include 
   -I${CMAKE_CURRENT_SOURCE_DIR}/include/hcana
   -I${Podd_DIR}/../../include
   -I${Podd_DIR}/../../include/podd2
-  -I/site/coda/3.10/Linux-x86_64/include
   TARGETS ${LIBNAME}
   LINKDEF include/HallC_LinkDef.h 
   )
-- 
GitLab