aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2019-03-06 15:31:41 +0100
committerFriedrich W. H. Kossebau <kossebau@kde.org>2019-03-06 17:42:18 +0100
commitd996a0fba67d31c7586934736d93232847d9ef9f (patch)
tree26b36a6769969f12b954576d968d25b59f992a39
parent78d49e456a75fd3e894c5eeeaad7e534818064d4 (diff)
downloadkconfig-d996a0fba67d31c7586934736d93232847d9ef9f.tar.gz
kconfig-d996a0fba67d31c7586934736d93232847d9ef9f.tar.bz2
KCONFIG_ADD_KCFG_FILES macro: ensure a change of File= in kcfg is picked up
Summary: The build configuration depends on the value of the "File=" entry in the kcfg file, as this file name is used in the build instructions. So if the name is changed, cmake would need to be rerun. Adding the kcfgc file to CMAKE_CONFIGURE_DEPENDS makes cmake know about that dependency. While this will also result in a reconfiguarion if non-File entries are edited, this should not happen too often, so the extra costs outweighs the unexpected and confusing behaviour due to outdated build instructions in case the File= entry is changed. Test Plan: Before this change renaming a kcfg file before did not trigger a rerun of cmake, resulting in outdated builds instructions and unexpected behaviour. With this change cmake is rerun once the kcgc file is edited, so build instructions are always up-to-date. Reviewers: #frameworks, apol Reviewed By: apol Subscribers: apol, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D19567
-rw-r--r--KF5ConfigMacros.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/KF5ConfigMacros.cmake b/KF5ConfigMacros.cmake
index b12723f7..65af42a6 100644
--- a/KF5ConfigMacros.cmake
+++ b/KF5ConfigMacros.cmake
@@ -57,6 +57,11 @@ function (KCONFIG_ADD_KCFG_FILES _sources )
set(_basename ${_rel_PATH}/${_basename})
endif()
+ # if the file name in the kcfgc is changed, we need to rerun cmake
+ set_property(DIRECTORY APPEND
+ PROPERTY CMAKE_CONFIGURE_DEPENDS ${_tmp_FILE}
+ )
+
file(READ ${_tmp_FILE} _contents)
string(REGEX MATCH "File=([^\n]+\\.kcfg)\n" "" "${_contents}")
set(_kcfg_FILENAME "${CMAKE_MATCH_1}")