@@ -133,12 +133,23 @@ function(add_root_dictionary target)
133133 set (includeDirs $<REMOVE_DUPLICATES :${includeDirs} >)
134134
135135 list (LENGTH A_EXTRA_PATCH hasExtraPatch)
136+
137+ set (_pcmdeps "$<REMOVE_DUPLICATES :${list_pcm_deps_ ${target} }>" )
138+ set (depSignatureFile ${CMAKE_CURRENT_BINARY_DIR} /${dictionary} _pcmdeps.txt)
139+
140+ file (GENERATE
141+ OUTPUT ${depSignatureFile}
142+ CONTENT "$<JOIN :${_pcmdeps} ,\n >"
143+ )
144+
136145 # add a custom command to generate the dictionary using rootcling
137146 # cmake-format: off
138147 add_custom_command (
139148 OUTPUT ${dictionaryFile} ${pcmFile} ${rootmapFile}
140149 VERBATIM
141150 COMMAND
151+ ${CMAKE_COMMAND} -E rm -f ${dictionaryFile} ${pcmFile} ${rootmapFile}
152+ COMMAND
142153 ${CMAKE_BINARY_DIR} /rootcling_wrapper.sh
143154 --rootmap_file ${rootmapFile}
144155 --dictionary_file ${dictionaryFile}
@@ -149,11 +160,11 @@ function(add_root_dictionary target)
149160 $<$<BOOL :${prop} >:-D $<JOIN :${prop} ,$<SEMICOLON >-D >>
150161 $<$<BOOL :${hasExtraPatch} >:--extra -patch >
151162 $<$<BOOL :${hasExtraPatch} >:${CMAKE_CURRENT_LIST_DIR} /${A_EXTRA_PATCH} >
152- --pcmdeps "$< REMOVE_DUPLICATES :${ list_pcm_deps_ ${target} }> "
163+ --pcmdeps "${_pcmdeps} "
153164 --headers "${headers} "
154165 COMMAND
155166 ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR} /${pcmBase} ${pcmFile}
156- DEPENDS ${headers} "$<REMOVE_DUPLICATES :${list_pcm_deps_ ${target} }>" ${A_EXTRA_PATCH} )
167+ DEPENDS ${headers} "$<REMOVE_DUPLICATES :${list_pcm_deps_ ${target} }>" ${depSignatureFile} ${ A_EXTRA_PATCH} )
157168 # cmake-format: on
158169
159170 # add dictionary source to the target sources
0 commit comments