Makefiles: Changing CMake versions forces complete rebuild
I'm not sure if this is the only reason, but at least this looks suspicious to me.
My use-case: I build my project during development using CLion, which comes with an bundled CMake version. But often I build it from command line too (in the same directories), for example all variants (debug, release) before I commit changes. Command line uses python virtualenv, where I have another CMake version installed.
The CMake version (CLion and Python) mismatch in version. I recognized, running CMake with one method has an influence to the other method, then everything is rebuilt there. It took me a long time to realize, that in some generated files this comment is included: Generated by "Unix Makefiles" Generator, CMake Version X.YZ
. I guess this is the culprit for the rebuild? I found flags.make, build.make, depend.make for example.
I'm not sure whats the reason to add the version number here, but if it is the only reason for invalidating the compiled files, I would prefer to remove the version information from the comment.
Am I right with my observation? Or are there other, unavoidable reasons?
Please don't recommend to use the same CMake executable in all build variants, this is my current workaround. But is annoying, I have to change CLion settings for example.