[CMake] Complete rebuild after svn update

Alex Brooks a.brooks at marathon-targets.com
Mon Oct 18 17:54:40 EDT 2010


> Have you checked the Makefiles which CMake creates
> to see if there are any surprising dependencies
> which could be causing the large extent of the recompile.

Do you mean CMakeFiles/Xxx.dir/depend.cmake ?
Yes, I checked these -- nothing interesting here.

Actually I've just figured out the problem.  Someone had added some CMake code 
that adds a definition setting the svn version number (using add_definitions).  
This gets called from the top level.  So every svn update results in a new 
"-DXxxx", and therefore every source file is re-compiled.


Alex


> Alex Brooks wrote:
> > 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?
> > _______________________________________________
> > Powered by www.kitware.com
> > 
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> > 
> > Please keep messages on-topic and check the CMake FAQ at:
> > http://www.cmake.org/Wiki/CMake_FAQ
> > 
> > Follow this link to subscribe/unsubscribe:
> > http://www.cmake.org/mailman/listinfo/cmake
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

-- 
------------------------------
Dr Alex Brooks

Marathon Targets Pty Ltd
National Innovation Centre
4 Cornwallis Street
Eveleigh, NSW 2015
Sydney, Australia
Ph: +61 2 9209 4021
Web: www.marathon-targets.com
------------------------------


More information about the CMake mailing list