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

2012-08-14 Thread Eric Noulard
2012/8/14 Peng Yu : >>> o Makepp will not recompile if only comments or whitespace in >>> C/C++ sources have changed. This is especially important for header >>> files which are automatically generated by other programs and are >>> included in many modules. Even if the date has changed beca

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

2012-08-14 Thread Peng Yu
>> o Makepp will not recompile if only comments or whitespace in >> C/C++ sources have changed. This is especially important for header >> files which are automatically generated by other programs and are >> included in many modules. Even if the date has changed because the >> file was re

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

2012-08-14 Thread Michael Wild
On 08/14/2012 04:32 PM, Peng Yu wrote: >> 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... > > I get your point that there is not an easy to do content

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

2012-08-14 Thread Peng Yu
> 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... I get your point that there is not an easy to do content based dependency (hash as an approximation) f

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

2012-08-14 Thread Michael Wild
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

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

2012-08-14 Thread Peng Yu
> 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 fir

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

2012-08-14 Thread Michael Wild
On 08/14/2012 01:18 PM, Peng Yu wrote: >> CMake really leaves the decision when to recompile something to the >> backend, i.e. GNU Make, Xcode, Visual Studio, ninja etc. It merely >> defines dependencies and then lets the actual build tool handle the >> rest, and most of them choose to use simple t

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

2012-08-14 Thread Peng Yu
> CMake really leaves the decision when to recompile something to the > backend, i.e. GNU Make, Xcode, Visual Studio, ninja etc. It merely > defines dependencies and then lets the actual build tool handle the > rest, and most of them choose to use simple time-stamps instead of Although GNU Make na

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

2012-08-14 Thread J Decker
Pretty much every build system will rebuild if you touch the file. This is a way to force it to compile it's a feature not a bug :) On Mon, Aug 13, 2012 at 10:56 PM, Michael Wild wrote: > CMake really leaves the decision when to recompile something to the > backend, i.e. GNU Make, Xcode, Visu

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

2012-08-13 Thread Michael Wild
CMake really leaves the decision when to recompile something to the backend, i.e. GNU Make, Xcode, Visual Studio, ninja etc. It merely defines dependencies and then lets the actual build tool handle the rest, and most of them choose to use simple time-stamps instead of hashes. Also note that comput

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

2012-08-13 Thread Peng Yu
Hi, The following command output shows that when I touch a source without changing the content, the source are compiled and linked, which is a waste. This post shows how to use the checksum to decide whether a file is changed or not, if changed then update target. This feature seems to be missing