[CMake] Complete rebuild after svn update
Alex Brooks
a.brooks at marathon-targets.com
Mon Oct 18 04:45:21 EDT 2010
Thanks for the quick responses.
Comments inline:
Eric:
> May be svn is the culprit.
>
> Did you have a look at the timestamp of the file/directory enclosing
> (and up) the
> changed CMakeLists.txt after the svn update?
>
> May be a single change inside a directory change the timestamp
> of a set of file?
When an svn update pulls in a change to a CMakeLists.txt file, the following
timestamps are updated:
1. the timestamp of the CMakeLists.txt file itself, and
2. the timestamp of the directory.
If I manually do a 'touch CMakeLists.txt', it changes the timestamp of the file
itself but not the directory.
I don't know why this might cause a complete rebuild.
If I manually do 'touch .; touch CMakeLists.txt; make' somewhere in the source
tree, it doesn't force a rebuild.
> Another option may be that this particular CMakeLists.txt is generating
> (using configure_file) some file that is [indirectly] included by many
> other?
I've looked for this kind of thing. Files which do not depend on any
dynamically-generated files also get rebuilt.
> May be you can have look at the dependencies in
> CMakeFiles/Makefile.cmake
I don't have this file, but I have CMakeFiles/Xxx.dir/depend.cmake.
Here's a sample:
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 2.8
orca/src/hydrolibs/hydrodll/CMakeFiles/HydroDll.dir/dll.cpp.o:
orca/src/hydrolibs/hydrodll/dll.cpp
orca/src/hydrolibs/hydrodll/CMakeFiles/HydroDll.dir/dll.cpp.o:
orca/src/hydrolibs/hydrodll/dll.h
orca/src/hydrolibs/hydrodll/CMakeFiles/HydroDll.dir/dll.cpp.o:
orca/src/hydrolibs/hydrodll/exceptions.h
In this case, when a rebuild is forced I always see dll.cpp.o get rebuilt
(despite no changes to dll.h/dll.cpp/exceptions.h)
All of these files are written by hand, not are generated using configure_file.
Marcel:
> Or do you use keyword expansion in your CMakeLists.txt file. Keywords,
> like $Id$, $Author$, etc. are a relict from CVS, but still supported by
> Subversion, though you have to explicitly activate it using properties.
No, I don't use anything like this. If I diff the files mentioned in e.g. the
"hydrodll" directory above, there are no changes (and the timestamps haven't
moved). But an svn update to an unrelated directory causes a rebuild.
Any other ideas?
More information about the CMake
mailing list