Last-modified timestamps of external CMake files that belong to system packages can be too old
Here KDevelop relies on CMake file timestamps. A CMake file, such as /usr/lib/cmake/Qt5/Qt5ConfigVersion.cmake, has the last-modified timestamp of the time when the package was built by a distro maintainer. The package can be installed (updated) on an end user's system much later. If the last build of a program, which depends on such a CMake file, is made between these two dates, KDevelop considers the CMake API reply index file up-to-date and doesn't rerun the CMake configure and generate steps. The build then fails with an error like this:
ninja: error: '/usr/lib/libQt5Core.so.5.15.8', needed by '/path/to/program/lib.so', missing and no known rule to make it
The user has to figure out that CMake configure needs to be rerun manually or the project reloaded in KDevelop. I personally wasted quite some time before figuring this out.
Can we somehow detect the issue and rerun CMake? Or at least show a general hint about the issue somewhere to help the users understand the problem and the solution faster?