[yocto] cmake + qt4e in bitbake fails to detect/supply all requested qt include paths

Cody P Schafer dev at codyps.com
Tue Aug 26 07:38:16 PDT 2014


This works with qt4 (non-embedded) when built natively, is there some
bitbake incantation I'm missing to have qt4e+cmake work? Or does qt4e
just not play nice with cmake?

Error message:
----
| [100%] Building CXX object CMakeFiles/kiosk-web.dir/kiosk.cc.o
| /home/cody/obj/yocto/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
  -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -march=armv7-a
-mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8
--sysroot=/home/cody/obj/yocto/tmp/sysroots/beaglebone  -O2 -pipe -g
-feliminate-unused-debug-types -fvisibility-inlines-hidden
-fpermissive -isystem
/home/cody/obj/yocto/tmp/sysroots/x86_64-linux/usr/include/qt4
-isystem /home/cody/obj/yocto/tmp/sysroots/x86_64-linux/usr/include/qt4/QtGui
-isystem /home/cody/obj/yocto/tmp/sysroots/x86_64-linux/usr/include/qt4/QtCore
   -o CMakeFiles/kiosk-web.dir/kiosk.cc.o -c
/home/cody/obj/yocto/tmp/work/cortexa8hf-vfp-neon-poky-linux-gnueabi/kiosk-web/0.0+gitrAUTOINC+dfe3db9730-r0/git/kiosk-web/kiosk.cc
| /home/cody/obj/yocto/tmp/work/cortexa8hf-vfp-neon-poky-linux-gnueabi/kiosk-web/0.0+gitrAUTOINC+dfe3db9730-r0/git/kiosk-web/kiosk.cc:6:28:
fatal error: QGraphicsWebView: No such file or directory
|  #include <QGraphicsWebView>
|                             ^
----

Relevent portion of my kiosk-web_0.1.bb file (remainder is srcs, revs,
desc, and license junk)
----
S = "${WORKDIR}/git/${PN}"
inherit cmake qt4e
do_configure () {
    cmake_do_configure
}
----

CMakeLists.txt:
----
cmake_minimum_required(VERSION 2.6)
project(kiosk-web)
find_package(Qt4 REQUIRED)

set(kiosk-web_SOURCES kiosk.cc)
set(QT_USE_QTWEBKIT 1)

include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})

add_executable(kiosk-web ${kiosk-web_SOURCES})
target_link_libraries(kiosk-web ${QT_LIBRARIES})
----

kiosk.cc :
----
#include <QApplication>

#include <QGraphicsScene>
#include <QGraphicsView>

#include <QGraphicsWebView>
#include <QWebSettings>

int main(int argc, char **argv)
{
    QApplication app(argc, argv);

    QGraphicsScene scene;
    QGraphicsView view(&scene);
    view.setFrameShape(QFrame::NoFrame);
    view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    QGraphicsWebView webview;
    webview.load(QUrl("http://google.com/"));
    webview.setResizesToContents(true);

    scene.addItem(&webview);
    view.showFullScreen();

    return app.exec();
}
----



More information about the yocto mailing list