From 29b84422fe7887e818d840c3234050510efa9fc7 Mon Sep 17 00:00:00 2001 From: Juan Miguel Carceller Date: Tue, 6 Oct 2026 07:40:45 +0200 Subject: [PATCH 1/3] [cmake] Only add the Core dependency to dictionaries when Core is a target --- cmake/modules/RootMacros.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 478c73627ae31..42ade075d1ed5 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -631,7 +631,9 @@ function(ROOT_GENERATE_DICTIONARY dictionary) #---Get the library and module dependencies----------------- # Every dictionary implicitly depends on Core's pcm, except the one for Core itself. - if(ARG_MODULE AND NOT ARG_MODULE STREQUAL "Core") + # Only when building ROOT itself: downstream projects have no plain 'Core' target + # (only ROOT::Core), and a bare 'Core' in DEPENDS would be treated as a file. + if(ARG_MODULE AND NOT ARG_MODULE STREQUAL "Core" AND TARGET Core) list(INSERT ARG_DEPENDENCIES 0 Core) list(REMOVE_DUPLICATES ARG_DEPENDENCIES) endif() From 931d14d19864816b74f81fa1d367f58e01538d9d Mon Sep 17 00:00:00 2001 From: Juan Miguel Carceller <22276694+jmcarcell@users.noreply.github.com> Date: Tue, 6 Oct 2026 10:54:49 +0200 Subject: [PATCH 2/3] Add always the Core or ROOT::Core dependency Co-authored-by: Philippe Canal --- cmake/modules/RootMacros.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 42ade075d1ed5..5c93de05bb98c 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -633,10 +633,14 @@ function(ROOT_GENERATE_DICTIONARY dictionary) # Every dictionary implicitly depends on Core's pcm, except the one for Core itself. # Only when building ROOT itself: downstream projects have no plain 'Core' target # (only ROOT::Core), and a bare 'Core' in DEPENDS would be treated as a file. - if(ARG_MODULE AND NOT ARG_MODULE STREQUAL "Core" AND TARGET Core) - list(INSERT ARG_DEPENDENCIES 0 Core) - list(REMOVE_DUPLICATES ARG_DEPENDENCIES) - endif() + if(ARG_MODULE AND NOT ARG_MODULE STREQUAL "Core") + if(TARGET Core) + list(INSERT ARG_DEPENDENCIES 0 Core) + elseif(TARGET ROOT::Core) + list(INSERT ARG_DEPENDENCIES 0 ROOT::Core) + endif() + list(REMOVE_DUPLICATES ARG_DEPENDENCIES) + endif() foreach(dep ${ARG_DEPENDENCIES}) # Whether provides a dictionary/pcm is decided at generation time # via $>, so the '-m' flag and the module-file From 449f28bf9338a5a146302d2d1fec18142ab82ae0 Mon Sep 17 00:00:00 2001 From: Juan Miguel Carceller Date: Tue, 6 Oct 2026 12:25:30 +0200 Subject: [PATCH 3/3] [cmake] Check ROOT::Core before Core Prefer the namespaced Core target when both target names are available. Assisted-by: pi:gpt-6.1-sol --- cmake/modules/RootMacros.cmake | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 5c93de05bb98c..d3919aa27dd81 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -634,13 +634,13 @@ function(ROOT_GENERATE_DICTIONARY dictionary) # Only when building ROOT itself: downstream projects have no plain 'Core' target # (only ROOT::Core), and a bare 'Core' in DEPENDS would be treated as a file. if(ARG_MODULE AND NOT ARG_MODULE STREQUAL "Core") - if(TARGET Core) - list(INSERT ARG_DEPENDENCIES 0 Core) - elseif(TARGET ROOT::Core) - list(INSERT ARG_DEPENDENCIES 0 ROOT::Core) - endif() - list(REMOVE_DUPLICATES ARG_DEPENDENCIES) - endif() + if(TARGET ROOT::Core) + list(INSERT ARG_DEPENDENCIES 0 ROOT::Core) + elseif(TARGET Core) + list(INSERT ARG_DEPENDENCIES 0 Core) + endif() + list(REMOVE_DUPLICATES ARG_DEPENDENCIES) + endif() foreach(dep ${ARG_DEPENDENCIES}) # Whether provides a dictionary/pcm is decided at generation time # via $>, so the '-m' flag and the module-file