From 4f1bc42ad4fb766107ef417f4ec189fce30e3957 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Tue, 10 Sep 2013 11:46:28 +0000
Subject: [PATCH] Make location of MakeRootMap.cmake to DD4hep_ROOT if it
 exists. In that case DD4hep is an external library. Now examples can be
 compiled against it.

---
 cmake/DD4hep.cmake | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cmake/DD4hep.cmake b/cmake/DD4hep.cmake
index 5fe467b18..c5bf6644f 100644
--- a/cmake/DD4hep.cmake
+++ b/cmake/DD4hep.cmake
@@ -5,6 +5,10 @@
 #---------------------------------------------------------------------------------------------------
 function(dd4hep_generate_rootmap library)
 
+  if ( NOT DD4hep_ROOT )
+    SET ( DD4hep_ROOT ${CMAKE_SOURCE_DIR} )
+  endif()
+
   find_package(ROOT QUIET)
   set(rootmapfile ${CMAKE_SHARED_MODULE_PREFIX}${library}.rootmap)
 
@@ -13,7 +17,7 @@ function(dd4hep_generate_rootmap library)
   add_custom_command(OUTPUT ${rootmapfile}
                      COMMAND ${CMAKE_COMMAND} -Dlibname=${libname} -Drootmapfile=${rootmapfile}
                              -Dgenmap_install_dir=${LIBRARY_OUTPUT_PATH}
-                             -P ${CMAKE_SOURCE_DIR}/cmake/MakeRootMap.cmake
+                             -P ${DD4hep_ROOT}/cmake/MakeRootMap.cmake
                      DEPENDS ${library})
 
   add_custom_target(${library}Rootmap ALL DEPENDS ${rootmapfile})
-- 
GitLab