[CMake] Source file symlinks on out-of-source builds

Rodolfo Schulz de Lima rodolfo at rodsoft.org
Thu Dec 3 15:11:24 EST 2009


Andreas Pakulat wrote:
> We're using out-of-source builds (custom buildsystem) at work for about
> almost a year now. And in fact none of the developers uses an IDE, its
> emacs or vi. And none of them ever complained about that particular
> problem, I don't know exactly how they manage that (I'm usually having
> two terminals, one for building one for editing, but then again I'm not
> a big vi or emacs uses). I suppose the CWD for vi/emacs is inside the
> sourcedir and they've got a special command set up that would run the
> buildtool inside some other (the builddir). 

I'm interested to know how they manage this. But even with if you run
make with -C to change to the build directory, the executable would be
generated there. This feels awkward when you are used to in-source
builds. Inside vi I usually do ":make" then ":!./progname".

> I really don't see a good enough reason that would outweight the huge
> stack of problems you get when starting to symlink stuff.

Although I understand that it's not trivial to manage the symlinks, I
wouldn't call it "a huge stack of problems". And if you make the symlink
tree generation optional, only those interested will be benefited.

> BTW: I have some experience with buildsystem-scripts using symlinks to
> get source files into the builddir (not for editing, but because the
> actual buildsystem needs it) and it means that on each update you have
> to remove the complete builddir because you cannot be certain wether all
> new links are there and all dead ones are removed. The only way for
> cmake to do it right would be recursively deleting all symlinks on each
> cmake invocation and re-create them.

I don't think it's the only way to do it. I think I've replied your
other message about this issue.

Regards,
Rodolfo Lima



More information about the CMake mailing list