Qt and Kde4 running make after running CMake

625 views Asked by At

I'm trying to build my own plugin for use with KDevelop. I can CMake and build a Makefile but when I run make I get a lot of errors relating to it not finding anything from Qt such as "QString does not specify a type. Is there something I need to add in order for my KDE plugin to build with Qt?

Errors:

/usr/include/KDE/../kurl.h:27:27: error: QtCore/QVariant: No such file or directory
/usr/include/KDE/../kurl.h:28:23: error: QtCore/QUrl: No such file or directory
In file included from /usr/include/kconfig.h:27,
                 from /usr/include/ksharedconfig.h:25,
                 from /usr/include/KDE/../kcomponentdata.h:23,
                 from /usr/include/KDE/KComponentData:1,
                 from /usr/include/vcs/dvcs/dvcsplugin.h:26,
                 from /home/charlesj/devKDevelopPlugin/CSCMKPlugin.h:8,
                 from /home/charlesj/devKDevelopPlugin/moc_KPlugin.cpp:10,

and many more like this regarding QGlobal QObject etc.

and here is my CMakeListst.txt

project(kdev)
find_package( KDE4 REQUIRED )
include(KDE4Defaults)
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
########### next target ###############

set(kdev_PART_SRCS
    KPlugin.cpp
)

kde4_add_plugin(kdev ${kdev_PART_SRCS})



target_link_libraries(kdev ${KDE4_KIO_LIBS}
    ${KDE4_KPARTS_LIBS}
    kdevplatformutil
    kdevplatforminterfaces
    kdevplatformvcs
    kdevplatformproject
    kdevplatformlanguage
)

install(TARGETS kdev DESTINATION ${PLUGIN_INSTALL_DIR} )


########### install files ###############
install( FILES kdev.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install( FILES kdev.rc DESTINATION ${DATA_INSTALL_DIR}/kdev )

This is just a skeleton program trying to get KDevelop to load my plugin. Thanks again.

1

There are 1 answers

0
OliJG On BEST ANSWER

As it seems you've already found, you need to tell CMake where to find the Qt headers, ie:

include_directories( ${QT_INCLUDES} )