From 7671efdb0a4593e42ad09f73e2270d1daca6c77b Mon Sep 17 00:00:00 2001
From: Dmitry Romanov <romanovda@gmail.com>
Date: Fri, 2 Apr 2021 13:55:49 -0400
Subject: [PATCH] While find_package is commented out (I guess because of some
 discovery issues) find_library approach would have the same functionality but
 also allow to put CMake flag -DActs_ROOT... to set ACTS directory if it is
 not in the standard place. Acts_ROOT - is the recommended name by CMP0074
 cmake policy

---
 CMakeLists.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b2d5e2d..5be6b40 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,10 +2,12 @@ cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
 PROJECT(reference_detector
   VERSION 0.0.1
   LANGUAGES CXX
-  DESCRIPTION "A template dd4hep+acts detector"
+  DESCRIPTION "EIC Reference Detector (via dd4hep+acts)"
   )
 
 find_package( DD4hep REQUIRED COMPONENTS DDCore DDG4 )
+find_library(ACTS_CORE_LIBRARY NAMES ActsCore HINTS ${Acts_ROOT} $ENV{Acts_ROOT} PATH_SUFFIXES lib lib64)
+find_library(ACTS_PLUGIN_DD4HEP_LIBRARY NAMES ActsPluginDD4hep HINTS ${Acts_ROOT}  $ENV{Acts_ROOT} PATH_SUFFIXES lib lib64)
 
 #find_package(Acts REQUIRED COMPONENTS Core IdentificationPlugin TGeoPlugin DD4hepPlugin PATHS /home/whit/lib/cmake NO_DEFAULT_PATH)
 #find_package(Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo PluginDD4hep )
@@ -16,7 +18,7 @@ set(a_lib_name reference_detector)
 dd4hep_configure_output()
 
 dd4hep_add_plugin(${a_lib_name} SOURCES src/*.cpp
-        USES ActsCore ActsPluginDD4hep
+        USES ${ACTS_CORE_LIBRARY} ${ACTS_PLUGIN_DD4HEP_LIBRARY}
   )
 target_link_libraries(${a_lib_name}
   PUBLIC DD4hep::DDCore  DD4hep::DDRec
-- 
GitLab