Skip to contentSkip to conversation

need help in qt environment setup

DISCUSSION Alexander Varnin 1 participant 2 messages Nov 12, 2014 – Nov 13, 2014 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hello!
I am using yocto to build images and develop software for my freescale imx53 board.

I need some help setting up environment for QT based software development.

My software requires qt4 (embedded) support.

There is several ways to use toolchain.

First, I can use toolchain from build directory where I've compiled qt4-embedded recipe. There I create environment-setup script using command:

bitbake meta-ide-support

Second, I can build SDK for my image:

bitbake image-name -c populate_sdk

Third, I can use meta-toolchain-qt recipe to build QT containing SDK:

bitbake meta-toolchain-qte

The first two methods is most convenient for me, because I need some additional libraries that is not included in meta-toolchain-qte. The first method is better, because I develop software on the same host, where yocto is located, so I don't need separate SDK installation.

However, only the last method produces environment settings for QT placed in /opt/poky/1.6.1/sysroots/i686-pokysdk-linux/environment-setup.d folder.

Other two methods produce environment-setup scripts, but they don't create sysroots/i686-linux/environment-setup.d folder. So QT environment settings lacks from this installations.

The best way I would like to solve it, is to somehow make 'bitbake meta-ide-support' generate environment settings for QT in my build dir, so I can use my local (non-SDK) cross toolchain to build QT software. How can I achieve it?

It is ok for me to use SDK as well, however, I want it to be my image based SDK.

Thanks for any help.
Alexander.

#3 lore raw
In reply to a message not in the archive

13.11.2014 09:20, Yi Qingliang пишет:

Quoted 81 lines

and then use '${OE_QMAKE_QMAKE}' but not 'qmake' directly.

On Thu, Nov 13, 2014 at 2:18 PM, Yi Qingliang <[email protected] <mailto:[email protected]>> wrote:

    mkdir -p recipes-qt/meta
    touch meta-ide-qte-support.bb <http://meta-ide-qte-support.bb>

    fill the meta-ide-qte-support.bb <http://meta-ide-qte-support.bb>
    with following contents.
    and 'bitbake meta-ide-qte-support' just like 'bitbake
    meta-ide-support'.
    GOOD LUCK!


    CRIPTION = "Meta package for ensuring the build directory contains
    all appropriate toolchain packages for using an IDE & QTE"
    LICENSE = "MIT"
    LIC_FILES_CHKSUM =
    "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
                       
    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"

    DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native
    qemu-helper-native unfs3-native"
    DEPENDS += "qt4-embedded"
    PR = "r1"

    inherit meta toolchain-scripts

    QT_TOOLS_PREFIX = "${STAGING_DIR_NATIVE}${bindir}"

    toolchain_create_tree_env_script_append() {
        scriptori=${script}
        script=${scriptori}-qte

        rm -f $script
        touch $script
        cat $scriptori >> $script

        # please follow the corresponding variables in qt4e.bbclass
        echo 'export OE_QMAKE_LIBS_X11=""' >> $script
        echo 'export OE_QMAKE_LIBS_QT="qt"' >> $script
        echo 'export QT_DIR_NAME="qtopia"' >> $script
        echo 'export QT_LIBINFIX="E"' >> $script

        echo 'export OE_QMAKE_CFLAGS="$CFLAGS"' >> $script
        echo 'export OE_QMAKE_CXXFLAGS="$CXXFLAGS"' >> $script
        echo 'export OE_QMAKE_LDFLAGS="$LDFLAGS"' >> $script
        echo 'export OE_QMAKE_CC="$CC"' >> $script
        echo 'export OE_QMAKE_CXX="$CXX"' >> $script
        echo 'export OE_QMAKE_LINK="$CXX"' >> $script
        echo 'export OE_QMAKE_AR="$AR"' >> $script
        echo 'export
    OE_QMAKE_LIBDIR_QT=${STAGING_DIR_TARGET}${libdir}' >> $script
        echo 'export
    OE_QMAKE_INCDIR_QT=${STAGING_DIR_TARGET}${includedir}/${QT_DIR_NAME}'
    >> $script
        echo 'export OE_QMAKE_MOC=${QT_TOOLS_PREFIX}/moc4' >> $script
        echo 'export OE_QMAKE_UIC=${QT_TOOLS_PREFIX}/uic4' >> $script
        echo 'export OE_QMAKE_UIC3=${QT_TOOLS_PREFIX}/uic34' >> $script
        echo 'export OE_QMAKE_RCC=${QT_TOOLS_PREFIX}/rcc4' >> $script
        echo 'export
    OE_QMAKE_QDBUSCPP2XML=${QT_TOOLS_PREFIX}/qdbuscpp2xml4' >> $script
        echo 'export
    OE_QMAKE_QDBUSXML2CPP=${QT_TOOLS_PREFIX}/qdbusxml2cpp4' >> $script
        echo 'export
    OE_QMAKE_QT_CONFIG=${STAGING_DIR_TARGET}${datadir}/${QT_DIR_NAME}/mkspecs/qconfig.pri'
    >> $script
        echo 'export
    QMAKESPEC=${STAGING_DIR_TARGET}${datadir}/${QT_DIR_NAME}/mkspecs/linux-g++'
    >> $script
        echo 'export OE_QMAKE_QMAKE=${QT_TOOLS_PREFIX}/qmake2' >> $script

        # make a symbolic link to mkspecs for compatibility with
    Nokia's SDK
        # and QTCreator
        (cd ${QT_TOOLS_PREFIX}/..; ln -sf
    ${STAGING_DIR_TARGET}/usr/share/${QT_DIR_NAME}/mkspecs mkspecs;)
    }
Quoted 9 lines
    do_populate_ide_support () {
      toolchain_create_tree_env_script
    }

    do_populate_ide_support[nostamp] = "1"
    do_populate_ide_support[recrdeptask] = "do_package_write"
    addtask populate_ide_support before do_build after do_install

Thank you!

I used your suggestions and made it work for me with following differences:
- use of environment-setup.d folder (introduced with 457291f2ca084d1f43c0cca2175b448a22761887 and e7b9e1df19062cfbcd72c90295829424cae6fbed commits) instead of appending script.
- I created meta-ide-support.bbclass to avoid code duplication

Here is a draft patch attached of how I did it. I am ready to work on upstream-suitable patch for this feature, if someone wants to hint me how to do it properly.

From d83e00483b735db7e056f5683a5aaba60b16013e Mon Sep 17 00:00:00 2001
From: "A. Varnin" <[email protected]>
Date: Thu, 13 Nov 2014 16:18:20 +0300
Subject: [PATCH] recipes-qt: meta-ide-qte-support recipe introduced

meta-ide-qte-support is capable of generating environment-setup.d script for application development evironment with QT(e) support

---
 meta/classes/meta-ide-support.bbclass        | 12 ++++++++
 meta/recipes-core/meta/meta-ide-support.bb   |  9 +-----
 meta/recipes-qt/meta/meta-ide-qte-support.bb | 45 ++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+), 8 deletions(-)
 create mode 100644 meta/classes/meta-ide-support.bbclass
 create mode 100644 meta/recipes-qt/meta/meta-ide-qte-support.bb
meta/classes/meta-ide-support.bbclass new file +12 -0
new file mode 100644
index 0000000..16c759b
@@ -0,0 +1,12 @@
+
+DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native"
+
+inherit meta toolchain-scripts
+
+do_populate_ide_support () {
+  toolchain_create_tree_env_script
+}
+
+do_populate_ide_support[nostamp] = "1"
+addtask populate_ide_support before do_build after do_install
+
meta/recipes-core/meta/meta-ide-support.bb +1 -8
index 2f92912..b2e33a2 100644
@@ -4,14 +4,7 @@ LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
                     file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
-DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native"
 PR = "r3"
 
-inherit meta toolchain-scripts
+inherit meta-ide-support
 
-do_populate_ide_support () {
-  toolchain_create_tree_env_script
-}
-
-do_populate_ide_support[nostamp] = "1"
-addtask populate_ide_support before do_build after do_install
meta/recipes-qt/meta/meta-ide-qte-support.bb new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
1.9.1