From e53a9a3bd7526f07be76a8427c333d924695633e Mon Sep 17 00:00:00 2001
From: Axel Naumann <Axel.Naumann@cern.ch>
Date: Thu, 14 Feb 2019 10:52:10 +0100
Subject: [PATCH] [cmake] Do NOT strip full paths:

It is essential to keep the notion of non-relocatable headers, passed to
ROOT_GENERATE_DICTIONARY with full paths. The dictionary will remember them
with their original location, making sure that headers can be found at
runtime without -I or $ROOT_INCLUDE_PATH.

ROOT's headers will never be passed as full path; users as well as ROOT
itself (in contrast to the non-relocatable roottest) MUST pass relative
paths, as if they were to #include the header, together with a matching -I.
---
 cmake/modules/RootNewMacros.cmake | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/cmake/modules/RootNewMacros.cmake b/cmake/modules/RootNewMacros.cmake
index 412a7961cc7..7c2664389df 100644
--- a/cmake/modules/RootNewMacros.cmake
+++ b/cmake/modules/RootNewMacros.cmake
@@ -242,10 +242,6 @@ function(ROOT_GENERATE_DICTIONARY dictionary)
           list(APPEND _list_of_header_dependencies ${f})
         endif()
       endforeach()
-    elseif(IS_ABSOLUTE ${fp})
-      string(REGEX REPLACE "^${CMAKE_CURRENT_SOURCE_DIR}/" "" fp_no_csd ${fp})
-      list(APPEND headerfiles ${fp_no_csd})
-      list(APPEND _list_of_header_dependencies ${fp})
     else()
       find_file(headerFile ${fp} HINTS ${incdirs} NO_DEFAULT_PATH NO_SYSTEM_ENVIRONMENT_PATH)
       if(NOT headerFile)
@@ -878,10 +874,10 @@ endfunction()
 #---ROOT_STANDARD_LIBRARY_PACKAGE(libname
 #                                 [NO_INSTALL_HEADERS]         : don't install headers for this package
 #                                 [STAGE1]                     : use rootcling_stage1 for generating
-#                                 HEADERS header1 header2      : if not specified, globbing for *.h is used)
+#                                 HEADERS header1 header2      : relative header path as #included; pass -I to find them. If not specified, globbing for *.h is used
 #                                 NODEPHEADERS header1 header2 : like HEADERS, but no dependency is generated
 #                                 [NO_HEADERS]                 : don't glob to fill HEADERS variable
-#                                 SOURCES source1 source2      : if not specified, globbing for *.cxx is used)
+#                                 SOURCES source1 source2      : if not specified, globbing for *.cxx is used
 #                                 [NO_SOURCES]                 : don't glob to fill SOURCES variable
 #                                 [OBJECT_LIBRARY]             : use ROOT_OBJECT_LIBRARY to generate object files
 #                                                                and then use those for linking.
-- 
GitLab