From 2caf6144f06e8b8e88093251df086a277b755f42 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Thu, 27 Jun 2019 17:27:10 +0200
Subject: [PATCH] DD4hep_XML_Setup: use imported XercesC target

---
 cmake/DD4hep_XML_setup.cmake | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/cmake/DD4hep_XML_setup.cmake b/cmake/DD4hep_XML_setup.cmake
index de29655ca..b9a10f79c 100644
--- a/cmake/DD4hep_XML_setup.cmake
+++ b/cmake/DD4hep_XML_setup.cmake
@@ -1,8 +1,11 @@
 if(DD4HEP_USE_XERCESC)
   find_package( XercesC REQUIRED )
-  add_definitions(-DDD4HEP_USE_XERCESC)
-  include_directories(SYSTEM ${XERCESC_INCLUDE_DIRS})
-  set(XML_LIBRARIES ${XERCESC_LIBRARIES})
+  set_target_properties(XercesC::XercesC
+    PROPERTIES
+    COMPILE_DEFINITIONS DD4HEP_USE_XERCESC
+    INTERFACE_COMPILE_DEFINITIONS DD4HEP_USE_XERCESC
+    )
+  set(XML_LIBRARIES XercesC::XercesC)
 else()
   set ( DD4HEP_USE_XERCESC OFF )
   add_definitions(-DDD4HEP_USE_TINYXML)
-- 
GitLab