From d8e8506e6e17ea3a6d76c570a987b4d0b3dd0aa0 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Mon, 28 Oct 2019 19:00:09 +0100
Subject: [PATCH] CreatePlugin: use listcomponents targets directly

---
 cmake/DD4hep.cmake | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/cmake/DD4hep.cmake b/cmake/DD4hep.cmake
index ce7678502..77ca370ae 100644
--- a/cmake/DD4hep.cmake
+++ b/cmake/DD4hep.cmake
@@ -90,13 +90,10 @@ function(dd4hep_generate_rootmap_notapple library)
 
   add_custom_command(OUTPUT ${rootmapfile}
                      DEPENDS ${library}
-                     POST_BUILD
-                     COMMAND ${CMAKE_COMMAND} -Dlibname=$<TARGET_FILE_NAME:${library}> -Drootmapfile=${rootmapfile}
-                             -DDD4HEP_LISTCOMPONENTS_CMD=$<TARGET_FILE:DD4hep::listcomponents>
-                             -DLIBRARY_LOCATION=$<TARGET_FILE_DIR:${library}>
-                             -DDD4HEP_LIBRARY_LOCATION=$<TARGET_FILE_DIR:DD4hep::DDCore>
-                             -DDD4hep_DIR=${DD4hep_DIR}
-                             -P ${DD4hep_DIR}/cmake/MakeGaudiMap.cmake)
+                     COMMAND DD4hep::listcomponents -o ${rootmapfile} $<TARGET_FILE:${library}>
+                     WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH}
+                     )
+
   add_custom_target(Components_${library} ALL DEPENDS ${rootmapfile})
   SET( install_destination "lib" )
   if( CMAKE_INSTALL_LIBDIR )
-- 
GitLab