cmake issue: generated files in subdirs

Aaron J. Seigo aseigo at
Thu Mar 23 21:06:56 GMT 2006

On Thursday 23 March 2006 12:01, Alexander Neundorf wrote:
> Are you building in-source or out-of-source ?

out of source.

> Which problem does this cause for you ?

specifically, in porting i cam across a file includes the generated .h file 
which is in a subdir.. so the #include is:

#include <dir/generatedfile.h>

but generatedfile.h is in the top level dir. it just means more porting work 
and was a bit surprising to see generated files not ending up in the 
buildtree where they were in the sourcetree.

> If you have the problem that there are now two generated files with the
> same name, you have hit the leftovers from libtool and the convenience
> libs. 

not at all.

> Now all source files are just compiled at once for one target. So if 
> you have in different subdirs files with the same name, the generated moc
> files will have the same name. Even if they would be generated in different
> directories (which they are not currently), this wouldn't help anything.
> In order to find them, the path to them would have to be part of the
> include path. Which would mean the path to both files with the same name
> would be in the include path, and that for both files. Which would have the
> effect that both times when e.g. foo.moc gets included the same foo.moc
> would be included.

that's nice about moc and all, but we're talking about ui files here.

in the case of moc files, -I. being before all others should suffice (the moc 
file being in the local dir). in the case of ui files, they are for intents 
and purposes just other c++ code. ditto for kconfigxt generated code, etc...

the whole point of subdirs is to help organize and namespace files. i've 
worked on a few projects in the past where it was common to do:


and no, those weren't plugins ... it's a little odd to not be able to do that 
just because the source are autogenerated. on larger projects this will 
become more of an issue as file name collisions increase.

and while a project can certainly modify how it does things, it's a bit odd to 
modify something like that due to the -build system-. or is that the point, 
to remind the world that all build systems suck?

Aaron J. Seigo
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

Full time KDE developer sponsored by Trolltech (
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <>

More information about the kde-core-devel mailing list