From 96207d5c5c330aa57ae66b67a252e702e09fa0bd Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Mon, 17 Oct 2022 10:54:00 +0200
Subject: [PATCH] DDEve: root header was renamed in
 https://github.com/root-project/root/pull/11554

---
 DDEve/CMakeLists.txt       | 5 +++++
 DDEve/root7/WebDisplay.cpp | 9 +++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/DDEve/CMakeLists.txt b/DDEve/CMakeLists.txt
index 9f865d1d2..7b27cecc8 100644
--- a/DDEve/CMakeLists.txt
+++ b/DDEve/CMakeLists.txt
@@ -17,7 +17,12 @@ target_include_directories(DDEve_Interface
   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
   $<INSTALL_INTERFACE:include>
 )
+
 target_link_libraries(DDEve_Interface INTERFACE ROOT::Core ROOT::Rint ROOT::Eve ROOT::Gui ROOT::Graf3d ROOT::RGL ROOT::EG)
+if(ROOT_VERSION VERSION_GREATER_EQUAL 6.27.00)
+  target_link_libraries(DDEve_Interface INTERFACE ROOT::ROOTGeomViewer)
+endif()
+
 
 dd4hep_add_dictionary(G__DDEve
   SOURCES ../DDCore/include/ROOT/Warnings.h include/DDEve/*.h
diff --git a/DDEve/root7/WebDisplay.cpp b/DDEve/root7/WebDisplay.cpp
index 065036bb8..27975f98f 100644
--- a/DDEve/root7/WebDisplay.cpp
+++ b/DDEve/root7/WebDisplay.cpp
@@ -17,8 +17,13 @@
 
 // ROOT includes
 #include "ROOT/RDirectory.hxx"
+#if ROOT_VERSION_CODE >= ROOT_VERSION(6,27,00)
+#include "ROOT/RGeomViewer.hxx"
+using GEOM_VIEWER = ROOT::Experimental::RGeomViewer;
+#else
 #include "ROOT/REveGeomViewer.hxx"
-
+using GEOM_VIEWER = ROOT::Experimental::REveGeomViewer;
+#endif
 
 // C/C++ include files
 #include <cerrno>
@@ -76,7 +81,7 @@ static long webdisplay(Detector& description, int argc, char** argv) {
   }
 
   if (vol) {
-    auto viewer = std::make_shared<ROOT::Experimental::REveGeomViewer>(&mgr);
+    auto viewer = std::make_shared<GEOM_VIEWER>(&mgr);
     viewer->SelectVolume(vol->GetName());
     viewer->SetLimits();
     viewer->SetDrawOptions(opt);
-- 
GitLab