[CMake] How to build only when file contents are actually changed?

Michael Wild themiwi at gmail.com
Tue Aug 14 08:44:40 EDT 2012


On 08/14/2012 02:41 PM, Peng Yu wrote:
>> Again, using ccache solves this much more elegantly. And calling md5sum
>> twice is also not very nice...
> 
> I'm not sure ccache replaces hash. My understanding is that ccache
> speed up individual compilation, but all the targets that depends on
> it are still compiled. With hash, a file is checked first whether it
> should be recompiled, if not, it will not be recompiled, and all the
> targets that depend on it will not be compiled either. I'm not with a
> machine that I can check ccache as this moment. Please correct me if
> I'm wrong.
> 
> The following compares a few features. But since it is from waf, it
> might be biased in favor of waf. Nevertheless, there are some features
> that available in other tools missing in cmake.
> 
> http://code.google.com/p/waf/wiki/WafAndOtherBuildSystems
> 

You miss the point. If CMake wanted to offer hash-based checking, it
would need to do so for *all* backends, not just GNU Make. Good look
implementing that hack in Visual Studio or Xcode...

Michael


More information about the CMake mailing list