Trouble Building Qt4 Plugin - moc not being invoked?
Lindsay Mathieson
lindsay.mathieson at gmail.com
Sat Apr 28 09:48:09 BST 2012
On Sat, 28 Apr 2012 10:21:25 AM Andreas Pakulat wrote:
> You should use MODULE here not SHARED, since a plugin is not a shared
> library and usually doesn't get a soversion set or the version-symlinks.
Thanks, did not know that.
>
> 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?
cmake file now looks like:
project(kdewebkit-spellplugin)
find_package(KDE4 REQUIRED)
FIND_PACKAGE(Qt4 REQUIRED)
include (KDE4Defaults)
include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} )
SET(wk_SOURCES kspellplugin.cpp)
SET(wk_HEADERS kspellplugin.h qwebkitplatformplugin.h)
QT4_WRAP_CPP(wk_HEADERS_MOC ${wk_HEADERS})
ADD_LIBRARY(kdewebkit-spellplugin MODULE ${wk_SOURCES} ${wk_HEADERS_MOC})
target_link_libraries(kdewebkit-spellplugin ${KDE4_KDEUI_LIBS}
${QT_LIBRARIES})
Thanks for all the help.
--
Lindsay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop/attachments/20120428/240ef577/attachment.html>
More information about the KDevelop
mailing list