Trouble Building Qt4 Plugin - moc not being invoked?

Andreas Pakulat apaku at gmx.de
Sat Apr 28 10:04:55 UTC 2012


Hi,

On Sat, Apr 28, 2012 at 10:48, Lindsay Mathieson <
lindsay.mathieson at gmail.com> wrote:

> **
>
> On Sat, 28 Apr 2012 10:21:25 AM Andreas Pakulat wrote:
>
> > More importantly though, since you use the basic CMake commands instead
> of
>
> > the KDE wrappers, you need to add the moc-step yourself. You should use
>
> > QT4_WRAP_CPP to do that and include the generated files into your plugin.
>
> > This also means you need to remove a #include "kspellplugin.moc" in your
>
> > cpp file if it exists.
>
>
>
> Yup, just figured it out ! :) Now building and linking.
>
>
>
> What are the KDE Wrappers?
>

kde4_add_library, kde4_add_executable, see the documentation of the KDE4
module. Those wrappers enable automoc, which means you can simply
write #include "header.moc"  (IIRC) in the .cpp file and the buildsystem
will automatically generate a rule to run moc on header.h. Similarly it
supports moc'ing of .cpp files if you have QObject classes completely
inside the .cpp.

Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop/attachments/20120428/621c0897/attachment.html>


More information about the KDevelop mailing list