[CMake] File modification detection based on content (not timestamp)

Robin Vobruba czech at sunrise.ch
Wed Jan 7 18:46:39 EST 2009


2009/1/8, Nicolas Desprès <nicolas.despres at gmail.com>:
> On Wed, Jan 7, 2009 at 11:14 PM, Robin Vobruba <czech at sunrise.ch> wrote:
>  [...]
>
>  Hi Robin,
>
>
>  > We also recently moved from SVN to GIT with our main repository.
>  > Because of the way GIT works, we would like CMake to check for file
>  > modification based on file contents, rather then timestamps. This
>  > would let us use the advantages of GIT to its fullest, save us from
>  > keeping a separate local repository for each branch, and in general
>  > make development much more comfortable.
>  > If you want me to further explain all this, i would be happy to do that.
>
>
> I'm also using git and cmake and I use ccache to solve this problem.
>  When building after switching branch if you did not change anything
>  ccache hits the cache. I know ccache works well with gcc or mingw but
>  for other compiler I don't know. Maybe it is possible to use it only
>  with the Makefile generator of cmake.
>

I also tried ccache, but it does not solve the problem, it only makes
it less bad.
for example:
* compile branch A
* switch to branch B
* (possibly change some things, does not matter)
* switch to branch A
* compile branch A
assuming we use a separate build and install dir for each branch, the
second compile of branch A will take:
- with timestamps check and NO ccache: 7 min
- with timestamps check and ccache: 2 min
- with content check and NO ccache: 5 s (assuming that content checks
are much faster then compilation)


More information about the CMake mailing list