Building in the source tree. I don't like it. Do you?

Steven T. Hatton hattons at
Fri Feb 13 10:48:04 UTC 2004

Hash: SHA1

A long time ago I was trying to compile someting called KDE alph-4.  I 
couldn't get it to build on Solaris, so I posted to the kde users list.  The 
person who responded told me I needed to recompile gcc to make it work.  He 
gave me basic instructions on how to do this.  One aspect of those 
instructions as that I should create a build-directory at the same level as 
the root of the source tree, and cd into build-directory, 
then ../source-directory/configure $MY_CONFIG_ARGS && make && make install.

Most source will support this practice.  At first I was very insecure about 
trying something which seemed a radical departure from the norm.  I've since 
taken an extreme liking to that approach to compiling.  While working with 
KDevelop, I've discovered that the cvs tree frequently fails when attempting 
to build in this manner.  I believe that failure represents a bug, but this 
may well be a matter of personal taste.

I've also noticed that the default project configuration mixes source and 
object files.  I know there is/was a way around this, but IIRC, it is not 
intuitively obvious, and not supported directly by the (GUI) tools. IOW, 
there's no option to click which says 'select a build directory for 
compilation results'.  I'm not really sure if the same kind of separation of 
'real' source and moc generated files could be accomplished, but it seems 
desirable.  I guess the general theme of what I'm driving at is the original 
source tree should be virtually unchanged by the build process.  If generated 
code /does/ end up in the source tree, it should be placed in a separate 
directory, if possible.

What do others think of these suggestions.

Version: GnuPG v1.2.2 (GNU/Linux)


More information about the KDevelop-devel mailing list