make KDE4_AUTOMOC compatible to qmake

David Faure faure at kde.org
Tue Jun 26 14:02:29 CEST 2007


On Friday 22 June 2007, Matthias Kretz wrote:
> Is it ok if I commit the KDE4Macros.cmake change to make the delayed automoc 
> work? Or do you want to do it? Any showstoppers with it?
Alex?

> I just committed my patch to kde4automoc.cmake to make the moc include qmake 
> compatible there...
Thanks for that.

There's one last thing that is missing for kde4_automoc to be compatible with qmake,
and that would be: support for Q_OBJECT in .cpp files. This would be very very useful
for unit tests (writing one file instead of two).

Currently the only way to support that seems to be #include "moc_foo.cxx" (weird extension)
and QT4_WRAP_CPP(), but that's a bit too manual compared to kde4_automoc
(where listing all source files isn't needed).

So my request would be that moc_foo.cpp (for qmake compat) gets generated
when foo.cpp has Q_OBJECT and #includes moc_foo.cpp  -- and if this means too
much parsing it could be disabled by default and enabled by a directory-wide option,
but after all we have to load the .cpp files already for normal kde4_automoc, right?

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).


More information about the Kde-buildsystem mailing list