make KDE4_AUTOMOC compatible to qmake

Matthias Kretz kretz at kde.org
Sat Jun 9 11:20:08 CEST 2007


On Saturday 09 June 2007, Alexander Neundorf wrote:
> On Friday 08 June 2007 05:07, Matthias Kretz wrote:
> > On Friday 08 June 2007, Alexander Neundorf wrote:
> > > Using OBJECT_DEPENDS works more or less, but not 100%.
> > >
> > :( Is this a bug in cmake or is it some corner case that
> >
> > add_library/add_executable works around?
> >
> > > IOW we have to stay with a non-source-file extension.
> >
> > How about the attached patch? It creates a new top-level target that
> > depends on all moc custom commands and the library/executable target then
> > depends on that moc target.
> > I tried it with a clean kdelibs build and it created _all_ moc files
> > before it started any compile job. I'm not sure why cmake/make does that
> > but it's not really wrong either.
> >
> > A variation of the patch could be to check for .cpp files in
> > _automoc_FILES and only then add this additional top-level target. Else
> > do the same as before.
>
> I still have a patch here which moves the automoc test from cmake-time to
> build time (i.e. faster cmake run)
> This and your patch might fit together.
> I have to get it up-to-date and then we can see whether they work together.
> Please don't commit before.

OK, then I'll revert my local moc include changes in phonon - otherwise I 
can't work on it anymore... The reason why I'd like to have it working soon 
is that Trolltech wants to be able to compile phonon using qmake (makes it 
easier for them to work on Windows and MacOS).

BTW, I tried to implement what Thiago suggested (i.e. supporting automoc for 
cases where the moc file is not #included and supporting running the moc 
on .cpp files). It's quite a big change because there are many cases to 
support but I think it's possible. But that means reading not only all 
the .cpp files but also all the .h files which should slow down the automoc 
macro quite a bit. Let me know if you're interested in it.

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20070609/af263f84/attachment.pgp 


More information about the Kde-buildsystem mailing list