diff --git a/cmake/modules/RootNewMacros.cmake b/cmake/modules/RootNewMacros.cmake
index 6c71ef6833dad455fe02354e3074188a6a0cfc8b..e675215422eae5649ce55aec0b0c16f03f016661 100644
--- a/cmake/modules/RootNewMacros.cmake
+++ b/cmake/modules/RootNewMacros.cmake
@@ -272,7 +272,6 @@ function(ROOT_GENERATE_DICTIONARY dictionary)
                      rootcling_stage1 textinput thread unix winnt zip)
     foreach(core_folder ${core_folders})
       string(REPLACE "${CMAKE_SOURCE_DIR}/core/${core_folder}/inc/" ""  headerfiles "${headerfiles}")
-      string(REPLACE "${CMAKE_BINARY_DIR}/include/" "" headerfiles "${headerfiles}")
     endforeach()
   endif()
 
@@ -282,7 +281,6 @@ function(ROOT_GENERATE_DICTIONARY dictionary)
   if(PROJECT_NAME STREQUAL ROOT)
     foreach(hf ${headerfiles})
       string(REPLACE "${PROJECT_SOURCE_DIR}" "" hfrel "${hf}")
-      string(REPLACE "${CMAKE_BINARY_DIR}/include/" "" hfrel "${hf}")
       # Test folders don't follow this pattern and need absolute paths,
       # so we don't run our sanity check on them.
       if(NOT "${hfrel}" MATCHES "/test/")