[CMake] How to handle git branches

Andreas Pakulat apaku at gmx.de
Tue May 18 14:52:35 EDT 2010


Hi,

I've recently bumped into a few problems with my usage of cmake on a
git-hosted project and am wondering what others are doing in such cases.

The setup is as follows: The project's master branch has its dedicated
builddir. Now when working on a feature I create a branch from master,
but I re-use the buildsystem as maintaing n builddirs is a pita. 

This however brings problems with it as far as I can see, specifically
when switching back to master branch (for example to merge somebody
else's feature-branch and push it later on) as git resets the
modification times of files according to the branch. For make-based
systems that rely on those modification times this if of course
horrible, hence I ended up with various bogus build problems, ranging
from generated-source-files not being re-generated, strange compiler
errors to even linking errors because .o files weren't re-created.

So I'm wether anybody here has a good recipe how to handle this with the
cmake-generated makefiles? I'd like to avoid having separate builddirs
for each branch and just as well to do a full make clean each time the
branch is being changed (as that would mean exploding compile times).

Andreas

-- 
You will be married within a year, and divorced within two.


More information about the CMake mailing list