Surprisingly enough I’m seeing the same thing, with CMake 3.19.7 on Linux x86_64. When build
is already configured and nothing has changed, a subsequent cmake -B build -S .
leaves the build/CMakeCache.txt
timestamp untouched. (But there really has to be nothing changed.)
…Of course, if nothing’s changed, it’s difficult to see what kind of imperative there would be to force re-running of a custom command. Unless it’s being used for un-accounted-for side effects, in which case it would arguably be useful to instead account for those explicitly as dependencies in the build config.