From e52af7f770ec3e51460d832428f2cca214678e2a Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Wed, 13 Mar 2024 13:11:12 +0100
Subject: [PATCH] CMake: add_dd4hep_dictionary: try to ensure we recreate the
 dictionary when any input changes

I hope this will work fine. If the list of headers or linkdefs changes, then cmake should re-run anyway and that will call the file(Generate) to recreate the script, and if only the file content of headers or linkdefs changes, we only have to re-run the shell script.
---
 cmake/DD4hepBuild.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmake/DD4hepBuild.cmake b/cmake/DD4hepBuild.cmake
index f317a485a..e2829a8eb 100644
--- a/cmake/DD4hepBuild.cmake
+++ b/cmake/DD4hepBuild.cmake
@@ -608,7 +608,7 @@ function(dd4hep_add_dictionary dictionary )
     )
     add_custom_command(OUTPUT ${dictionary}.cxx ${output_dir}/${dictionary}_rdict.pcm
       COMMAND /bin/sh fixed_create_${dictionary}_$<CONFIG>CXX.sh
-      DEPENDS fixed_create_${dictionary}_$<CONFIG>CXX.sh
+      DEPENDS fixed_create_${dictionary}_$<CONFIG>CXX.sh ${headers} ${linkdefs}
     )
   else()
     add_custom_command(OUTPUT ${dictionary}.cxx ${output_dir}/${dictionary}_rdict.pcm
-- 
GitLab