Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81689 - in trunk/tools/build/v2: test/qt4 tools
From: jhunold_at_[hidden]
Date: 2012-12-03 03:28:10


Author: jhunold
Date: 2012-12-03 03:28:09 EST (Mon, 03 Dec 2012)
New Revision: 81689
URL: http://svn.boost.org/trac/boost/changeset/81689

Log:
Add <rccflags> to qt4.jam. Fixes #7576

Thanks to Frank Richter for the initial patch and documentation.
Added:
   trunk/tools/build/v2/test/qt4/rcc.cpp (contents, props changed)
   trunk/tools/build/v2/test/qt4/rcc.qrc (contents, props changed)
Text files modified:
   trunk/tools/build/v2/test/qt4/jamroot.jam | 3 +++
   trunk/tools/build/v2/tools/qt4.jam | 23 ++++++++++++++++++++++-
   2 files changed, 25 insertions(+), 1 deletions(-)

Modified: trunk/tools/build/v2/test/qt4/jamroot.jam
==============================================================================
--- trunk/tools/build/v2/test/qt4/jamroot.jam (original)
+++ trunk/tools/build/v2/test/qt4/jamroot.jam 2012-12-03 03:28:09 EST (Mon, 03 Dec 2012)
@@ -57,6 +57,9 @@
       # Test moc rule
       [ run mock.cpp mock.h /qt//QtCore : : : <define>TEST_MOCK ]
 
+ # Test resource compiler
+ [ run rcc.cpp rcc.qrc /qt//QtCore : : : <rccflags>"-compress 9 -threshold 10" ]
+
    : # requirements
    : # default-build
    : # usage-requirements

Added: trunk/tools/build/v2/test/qt4/rcc.cpp
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/test/qt4/rcc.cpp 2012-12-03 03:28:09 EST (Mon, 03 Dec 2012)
@@ -0,0 +1,20 @@
+// (c) Copyright Juergen Hunold 2012
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#define BOOST_TEST_MODULE QtCore
+#include <QtCore>
+
+#include <boost/test/unit_test.hpp>
+
+std::ostream& operator<<(std::ostream& out, QString const& text)
+{
+ out << text.toUtf8().constData();
+ return out;
+}
+
+BOOST_AUTO_TEST_CASE (check_exists)
+{
+ BOOST_CHECK(QFile::exists(":/test/rcc.cpp"));
+}

Added: trunk/tools/build/v2/test/qt4/rcc.qrc
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/test/qt4/rcc.qrc 2012-12-03 03:28:09 EST (Mon, 03 Dec 2012)
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+ <qresource prefix="/test/">
+ <file>rcc.cpp</file>
+ </qresource>
+</RCC>

Modified: trunk/tools/build/v2/tools/qt4.jam
==============================================================================
--- trunk/tools/build/v2/tools/qt4.jam (original)
+++ trunk/tools/build/v2/tools/qt4.jam 2012-12-03 03:28:09 EST (Mon, 03 Dec 2012)
@@ -36,6 +36,21 @@
 # This is consistent with Qt guidelines:
 # http://qt-project.org/doc/qt-4.8/moc.html
 #
+# The .qrc processing utility supports various command line option (see
+# http://qt-project.org/doc/qt-4.8/rcc.html for a complete list). The
+# module provides default arguments for the "output file" and
+# "initialization function name" options. Other options can be set through
+# the <rccflags> build property. E.g. if you wish the compression settings
+# to be more aggressive than the defaults, you can apply them too all .qrc
+# files like this:
+#
+# project my-qt-project :
+# requirements
+# <rccflags>"-compress 9 -threshold 10"
+# ;
+#
+# Of course, this property can also be specified on individual targets.
+
 
 import modules ;
 import feature ;
@@ -72,6 +87,9 @@
 # Auto-detection via qmake sets '<qt>major.minor.patch'
 feature.feature qt : : propagated ;
 
+# Extra flags for rcc
+feature.feature rccflags : : free ;
+
 project.initialize $(__name__) ;
 project qt ;
 
@@ -701,11 +719,14 @@
 }
 
 
+# Get extra options for RCC
+flags qt4.rcc RCC_OPTIONS <rccflags> ;
+
 # Generates source files from resource files.
 #
 actions rcc
 {
- $(.BINPREFIX[-1])/rcc $(>) -name $(>:B) -o $(<)
+ $(.BINPREFIX[-1])/rcc $(>) -name $(>:B) $(RCC_OPTIONS) -o $(<)
 }
 
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk