From 57969939e3a08d3010acd74fb9296179c0c47778 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 17 Oct 2024 22:26:18 +0200 Subject: [PATCH] [cmake] watch config files As we do add configure_file output to clean target cmake configure must be rerun. To trigger that add source and generated file to CMAKE_CONFIGURE_DEPENDS --- cmake/CleaningConfigureFile.cmake | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/cmake/CleaningConfigureFile.cmake b/cmake/CleaningConfigureFile.cmake index 93ffb2737..52ee56e12 100644 --- a/cmake/CleaningConfigureFile.cmake +++ b/cmake/CleaningConfigureFile.cmake @@ -6,9 +6,17 @@ function(cleaning_configure_file SRC DST) configure_file(${SRC} ${DST} ${ARGN}) - set_property( - DIRECTORY - APPEND - PROPERTY ADDITIONAL_CLEAN_FILES ${DST} - ) + set_property( + DIRECTORY + APPEND + PROPERTY ADDITIONAL_CLEAN_FILES + ${DST} + ) + set_property( + DIRECTORY + APPEND + PROPERTY CMAKE_CONFIGURE_DEPENDS + ${SRC} + ${DST} + ) endfunction()