Trouble Building Qt4 Plugin - moc not being invoked?
apaku at gmx.de
Sat Apr 28 10:04:55 UTC 2012
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
> > 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KDevelop