The following MR in upstream CMake makes sure that the autogen targets
depend on the CMakeLists.txt file associated with the autogen target,
as well as any files it includes.
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5166
When doing a no-op reconfiguration in the build dir (call 'cmake .')
we used file(WRITE) to prepare the contents of a file to be used with
configure_file() for creation of a .qrc resource file.
Because this file was always rewritten on reconfiguration, its
timestamp was newer than then autogen target's timestamp which caused
the autogen targets to-be rerun, as well as some compilation and
relinking.
To avoid this, instead of using file(WRITE) ship a template file next
to the Qt6CoreMacros.cmake file, and use it as a template for the qrc
configure_file() call. This ensures that a reconfiguration doesn't
necessarily rebuild things it shouldn't rebuild.
Amends 113f1ad324
Task-number: QTBUG-88004
Change-Id: Icd95b28ca3642434cf21e5c49dcbd1ec65d76252
Reviewed-by: Cristian Adam <cristian.adam@qt.io>