From: Alexander Varnin <fenixk19@mail.ru>
To: Yi Qingliang <niqingliang2003@gmail.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: need help in qt environment setup
Date: Thu, 13 Nov 2014 16:26:41 +0300 [thread overview]
Message-ID: <5464B191.5030101@mail.ru> (raw)
In-Reply-To: <CADwFkYfYuhm14dAniVRZbCzcMoS8FQWHVOfNupCktU-tQ9TtCw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4183 bytes --]
13.11.2014 09:20, Yi Qingliang пишет:
> and then use '${OE_QMAKE_QMAKE}' but not 'qmake' directly.
>
> On Thu, Nov 13, 2014 at 2:18 PM, Yi Qingliang
> <niqingliang2003@gmail.com <mailto:niqingliang2003@gmail.com>> 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;)
> }
>
> 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.
[-- Attachment #2: 0001-recipes-qt-meta-ide-qte-support-recipe-introduced.patch --]
[-- Type: text/x-diff, Size: 4733 bytes --]
From d83e00483b735db7e056f5683a5aaba60b16013e Mon Sep 17 00:00:00 2001
From: "A. Varnin" <fenixk19@mail.ru>
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
Signed-off-by: A. Varnin <fenixk19@mail.ru>
---
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
diff --git a/meta/classes/meta-ide-support.bbclass b/meta/classes/meta-ide-support.bbclass
new file mode 100644
index 0000000..16c759b
--- /dev/null
+++ b/meta/classes/meta-ide-support.bbclass
@@ -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
+
diff --git a/meta/recipes-core/meta/meta-ide-support.bb b/meta/recipes-core/meta/meta-ide-support.bb
index 2f92912..b2e33a2 100644
--- a/meta/recipes-core/meta/meta-ide-support.bb
+++ b/meta/recipes-core/meta/meta-ide-support.bb
@@ -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
diff --git a/meta/recipes-qt/meta/meta-ide-qte-support.bb b/meta/recipes-qt/meta/meta-ide-qte-support.bb
new file mode 100644
index 0000000..42b4210
--- /dev/null
+++ b/meta/recipes-qt/meta/meta-ide-qte-support.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Integrated Development Environment support"
+DESCRIPTION = "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"
+
+inherit meta-ide-support
+
+DEPENDS += "qt4-embedded"
+PR = "r1"
+
+
+QT_TOOLS_PREFIX = "${STAGING_DIR_NATIVE}${bindir}"
+QT_DIR_NAME = "qtopia"
+
+
+toolchain_create_tree_env_script_append() {
+ mkdir -p ${STAGING_DIR_NATIVE}/environment-setup.d/
+ script=${STAGING_DIR_NATIVE}/environment-setup.d/${QT_DIR_NAME}.sh
+
+ 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=$OECORE_TARGET_SYSROOT${libdir}' >> $script
+ echo 'export OE_QMAKE_INCDIR_QT=$OECORE_TARGET_SYSROOT${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=$OECORE_TARGET_SYSROOT${datadir}/${QT_DIR_NAME}/mkspecs/qconfig.pri' >> $script
+ echo 'export QMAKESPEC=$OECORE_TARGET_SYSROOT${datadir}/${QT_DIR_NAME}/mkspecs/linux-g++' >> $script
+ echo 'export OE_QMAKE_QMAKE=${QT_TOOLS_PREFIX}/qmake2' >> $script
+ echo 'export QT_CONF_PATH=$OECORE_NATIVE_SYSROOT${sysconfdir}/qt.conf' >> $script
+
+ # make a symbolic link to mkspecs for compatibility with Qt SDK
+ # and Qt Creator
+ (cd ${STAGING_DIR_NATIVE}${bindir}/..; rm -f mkspecs; ln -s ${SDKTARGETSYSROOT}/usr/share/${QT_DIR_NAME}/mkspecs mkspecs;)
+}
+
--
1.9.1
prev parent reply other threads:[~2014-11-13 13:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-12 13:13 need help in qt environment setup Alexander Varnin
[not found] ` <CADwFkYd=SXmPxRGS5c7YnOkSwGhagN1sGnsTBuQiamg04RjQog@mail.gmail.com>
[not found] ` <CADwFkYfYuhm14dAniVRZbCzcMoS8FQWHVOfNupCktU-tQ9TtCw@mail.gmail.com>
2014-11-13 13:26 ` Alexander Varnin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5464B191.5030101@mail.ru \
--to=fenixk19@mail.ru \
--cc=niqingliang2003@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox