Patchwork [3/3] classes/qmake_base: update .pro hack

login
register
mail settings
Submitter Jonathan Liu
Date June 7, 2013, 5:15 a.m.
Message ID <1370582137-26940-4-git-send-email-net147@gmail.com>
Download mbox | patch
Permalink /patch/51251/
State Accepted
Commit 542fefa61f0ac1dcdacac2630fd44950ac11cdd9
Headers show

Comments

Jonathan Liu - June 7, 2013, 5:15 a.m.
This adds support for lconvert and xmlpatterns tools and tweaks the
sed expressions to handle more complex assignments in .pro files like:
LRELEASE = $$targetPath($$[QT_INSTALL_BINS]/lrelease)

Signed-off-by: Jonathan Liu <net147@gmail.com>
---
 meta/classes/qmake_base.bbclass | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/classes/qmake_base.bbclass b/meta/classes/qmake_base.bbclass
index 3762887..86bbede 100644
--- a/meta/classes/qmake_base.bbclass
+++ b/meta/classes/qmake_base.bbclass
@@ -94,9 +94,20 @@  qmake_base_do_configure() {
 	fi
 
 	# Hack .pro files to use OE utilities
+	LCONVERT_NAME=$(basename ${OE_QMAKE_LCONVERT})
+	LRELEASE_NAME=$(basename ${OE_QMAKE_LRELEASE})
+	LUPDATE_NAME=$(basename ${OE_QMAKE_LUPDATE})
+	XMLPATTERNS_NAME=$(basename ${OE_QMAKE_XMLPATTERNS})
 	find -name '*.pro' \
-	     -exec sed -i -e 's,=\s*.*/lrelease,= ${OE_QMAKE_LRELEASE},g' \
-	                  -e 's,=\s*.*/lupdate,= ${OE_QMAKE_LUPDATE},g' '{}' ';'
+	     -exec sed -i -e "s|\(=\s*.*\)/$LCONVERT_NAME|\1/lconvert|g" \
+	                  -e "s|\(=\s*.*\)/$LRELEASE_NAME|\1/lrelease|g" \
+	                  -e "s|\(=\s*.*\)/$LUPDATE_NAME|\1/lupdate|g" \
+	                  -e "s|\(=\s*.*\)/$XMLPATTERNS_NAME|\1/xmlpatterns|g" \
+	                  -e "s|\(=\s*.*\)/lconvert|\1/$LCONVERT_NAME|g" \
+	                  -e "s|\(=\s*.*\)/lrelease|\1/$LRELEASE_NAME|g" \
+	                  -e "s|\(=\s*.*\)/lupdate|\1/$LUPDATE_NAME|g" \
+	                  -e "s|\(=\s*.*\)/xmlpatterns|\1/$XMLPATTERNS_NAME|g" \
+	                  '{}' ';'
 
 #bbnote "Calling '${OE_QMAKE_QMAKE} -makefile -spec ${QMAKESPEC} -o Makefile $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST'"
 	unset QMAKESPEC || true