Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Building-Qt5-for-BlackBerry: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=Building Qt5 for BlackBerry=
[[Category:BlackBerry]]<br />[[Category:HowTo]]<br />[[Category:Developing_with_Qt::Qt 5]]
 
[toc align_right=&quot;yes&amp;quot; depth=&quot;2&amp;quot;]
 
= Building Qt5 for BlackBerry =


This page provides instructions on how to build Qt5 for BlackBerry 10 and the Playbook OS. Please note that the work is currently focused on Qt5 for BlackBerry 10. Qt5 might not build or not run well on the PlayBook OS, whereas Qt v5.1.1 is known to build and work with some potential issues when executing an application on Playbook.
This page provides instructions on how to build Qt5 for BlackBerry 10 and the Playbook OS. Please note that the work is currently focused on Qt5 for BlackBerry 10. Qt5 might not build or not run well on the PlayBook OS, whereas Qt v5.1.1 is known to build and work with some potential issues when executing an application on Playbook.


==Setting up the environment==
== Setting up the environment ==


See [[Setup-for-BlackBerry10-development|Setup for BlackBerry10 development]] for the introduction and further instructions.
See [[Setup for BlackBerry10 development]] for the introduction and further instructions.


==Getting the source==
== Getting the source ==


We do an in-source build of the Qt5 repositories that are needed and install them into dedicated build directory. <code>$HOME/development/qnx/qt5<code> is used in the examples below. Please also note that we clone and build git submodules separately. This procedure is different to the builds for desktop platforms and allows to include only those submodules which are relevant without managing a master repository. Please adjust the paths to suit your setup as needed.</code></code>
We do an in-source build of the Qt5 repositories that are needed and install them into dedicated build directory. &lt;code&amp;gt;$HOME/development/qnx/qt5&amp;lt;code&amp;gt; is used in the examples below. Please also note that we clone and build git submodules separately. This procedure is different to the builds for desktop platforms and allows to include only those submodules which are relevant without managing a master repository. Please adjust the paths to suit your setup as needed.


First create a directory to hold the source code:
First create a directory to hold the source code:


The following repositories are used in regular builds for BlackBerry 10 in [http://qtlab.blackberry.com BlackBerry’s public CI] ''[qtlab.blackberry.com]'' as of Qt 5.2 :
<code><br />cd $HOME/development<br />mkdir qt5<br />cd qt5<br /></code>
 
The following repositories are used in regular builds for BlackBerry 10 in &quot;BlackBerry's public CI&amp;quot;:http://qtlab.blackberry.com as of Qt 5.2 :


# qtbase
# qtbase
Line 21: Line 27:
# qtconnectivity
# qtconnectivity
# qtxmlpatterns
# qtxmlpatterns
# qtsensors
# qtsensors  
# qtquickcontrols
# qtquickcontrols


This matches all essential modules, plus several add-on modules. QtWebKit is currently not a part of the regular builds. Still, it is possible to build it, see [[Building-QtWebKit-for-Blackberry|Building QtWebKit for Blackberry]]
This matches all essential modules, plus several add-on modules. QtWebKit is currently not a part of the regular builds. Still, it is possible to build it, see [[Building-QtWebKit-for-Blackberry]]


Other repositories known to build:
Other repositories known to build:


# qtjsbackend (not relevant anymore for Qt 5.2 and later)
# qtjsbackend (not relevant anymore for Qt 5.2 and later)
# qt3d (optional, provides 3D scenes using <span class="caps">QML</span>)
# qt3d (optional, provides 3D scenes using QML)
# qtscript (optional, only needed when using the qtquick1 submodule)
# qtscript (optional, only needed when using the qtquick1 submodule)
# qtlocation
# qtlocation


Then clone:<br />
Then clone:<br /><code><br />git clone git://gitorious.org/qt/qtbase.git<br />git clone git://gitorious.org/qt/qtxmlpatterns.git<br />git clone git://gitorious.org/qt/qtsensors.git<br />git clone git://gitorious.org/qt/qtdeclarative.git<br />git clone git://gitorious.org/qt/qtmultimedia.git<br />git clone git://gitorious.org/qt/qtgraphicaleffects.git<br />git clone git://gitorious.org/qt/qtconnectivity.git<br />git clone git://gitorious.org/qt/qtquickcontrols.git
 
</code>


==Using the master repository==
== Using the master repository ==


The presented approach handles repositories from related Qt5 modules separately. If you prefer, you can also adapt the standard procedure based on a build from the master repository. You just need to make sure that your master repository has been initialized for those repositories which are actually supported on BlackBerry 10. The following can be used to initialize the master repository for the Qt modules out lined above:
The presented approach handles repositories from related Qt5 modules separately. If you prefer, you can also adapt the standard procedure based on a build from the master repository. You just need to make sure that your master repository has been initialized for those repositories which are actually supported on BlackBerry 10. The following can be used to initialize the master repository for the Qt modules out lined above:


==Building==
<code><br />./init-repository -f —no-webkit —module-subset=qtbase,qtxmlpatterns,qtdeclarative,qtsensors,qtmultimedia,qtgraphicaleffects,qtconnectivity,qtquickcontrols,qtlocation
 
</code>
 
== Building ==


The process of building Qt5 for BlackBerry devices is very similar to building it for any other platform so it is worth having a quick read through the [[Building Qt 5 from Git|generic instructions for building Qt5]] before proceeding.
The process of building Qt5 for BlackBerry devices is very similar to building it for any other platform so it is worth having a quick read through the [[Building_Qt_5_from_Git | generic instructions for building Qt5]] before proceeding.


Be sure that you have configured your environment to use the BlackBerry 10 <span class="caps">NDK</span> as described in [[BlackBerry]]. This especially concerns setting the right values in $PATH to pickup tools and the cross-compile tool-chain provided in the <span class="caps">NDK</span>.
Be sure that you have configured your environment to use the BlackBerry 10 NDK as described in [[Blackberry]]. This especially concerns setting the right values in $PATH to pickup tools and the cross-compile tool-chain provided in the NDK.


====Note====
==== Note ====


When building Qt5 with the latest public <span class="caps">NDK</span> some features might be disabled (Input Method Framework, <span class="caps">LGMON</span>, <span class="caps">NFC</span> Share). This is due to missing header files which have not been published yet.
When building Qt5 with the latest public NDK some features might be disabled (Input Method Framework, LGMON, NFC Share). This is due to missing header files which have not been published yet.


===The “configure” step===
=== The &quot;configure&amp;quot; step ===


First we need to configure Qt.
First we need to configure Qt.


====Linux/OS X====
==== Linux/OS X ====
 
The examples below show a minimal set of configure options. You can see the full set of configure options used in the &quot;BlackBerry's public CI&amp;quot;:http://qtlab.blackberry.com in the raw console output of the <code>qtbase<code> build. See &quot;this link&amp;quot;:http://qtlab.blackberry.com/job/qt-5-qtbase-stable/ and then open the raw &quot;Console Output&amp;quot; for the last successful build for ARM or for x86.
 
</code><br />cd qtbase<br />./configure -prefix $HOME/development/qnx/qt5 -xplatform blackberry-armle-v7-qcc -opengl es2 -nomake examples -nomake tests -opensource -confirm-license -release<br /><code>


When compiling for the PlayBook, use the following command:
When compiling for the PlayBook, use the following command:


And afterwards we simply build it by calling <code>make<code> and <code>make install<code>:</code></code></code></code>
</code><br />./configure -prefix $HOME/development/qnx/qt5 -device blackberry-playbook-armle-v7 -opengl es2 -nomake examples -nomake tests -opensource -confirm-license -release -no-neon<br /><code>
 
And afterwards we simply build it by calling &lt;code&amp;gt;make&amp;lt;code&amp;gt; and &lt;code&amp;gt;make install&amp;lt;code&amp;gt;:
 
</code><br />make -j&amp;lt;N&amp;gt;<br />make install<br /><code>
 
where &lt;N&amp;gt; is the number of parallel make jobs to run. Usually, this is set to &lt;No. of CPU cores + 1&amp;gt;.


where &lt;N&gt; is the number of parallel make jobs to run. Usually, this is set to &lt;No. of <span class="caps">CPU</span> cores + 1&gt;.
=== Windows ===


===Windows===
</code><br />C:&gt; cd qtbase<br />C:&gt; configure -prefix C:stall -xplatform blackberry-armle-v7-qcc -opengl es2 -nomake examples -nomake tests -opensource -confirm-license -release<br /><code>


For the PlayBook:
For the PlayBook:


And afterwards we simply build it by calling mingw32-make and mingw32-make install.
</code><br />C:&gt; cd qtbase<br />C:&gt; configure -prefix C:stall -device blackberry-playbook-armle-v7 -opengl es2 -nomake examples -nomake tests -opensource -confirm-license -release -no-c+''11 -no-pps<br /><code>
<br />And afterwards we simply build it by calling mingw32-make and mingw32-make install.
<br /></code><br />mingw32-make -j<br />mingw32-make install<br /><code>
<br />If you want to work with the HTTPS protocol, add '''-openssl''' option. ''need to check if the same is required on Linux''
<br />h3. Mac OS X
<br />This is almost the same as on Linux. We just add </code>-no-c11</code> option when compiling on Mac OSX, since the current version of the toolchain does not support c11.
<br /><code><br />$ cd qtbase<br />$ ./configure -prefix $HOME/development/qnx/qt5 -xplatform blackberry-armle-v7-qcc -opengl es2 -nomake examples -nomake tests -opensource -confirm-license -release -no-neon -no-c''+11<br /></code>


If you want to work with the <span class="caps">HTTPS</span> protocol, add '''-openssl''' option. ''need to check if the same is required on Linux''
=== The actual &quot;build&amp;quot; step ===


===Mac OS X===
After above steps have been completed you should have QtBase installed in the prefix directory (i.e. in $HOME/development/qnx/qt5 or in C:stall, depending on your operating system).


===The actual “build” step===
In order to complete build, we go through all modules and build them as &quot;regular&amp;quot; Qt projects, but use use the &lt;code&amp;gt;qmake&amp;lt;code&amp;gt; '''from our new Qt5 installation''' (i.e. from the prefix directory). A few modules have dependencies to each other. Make sure you build modules in the order as listed above.


After above steps have been completed you should have QtBase installed in the prefix directory (i.e. in $HOME/development/qnx/qt5 or in C:\dev\qt5install, depending on your operating system).
=== Extend the path ===


In order to complete build, we go through all modules and build them as “regular” Qt projects, but use use the <code>qmake<code> '''from our new Qt5 installation''' (i.e. from the prefix directory). A few modules have dependencies to each other. Make sure you build modules in the order as listed above.</code></code>
On Linux or OS X


===Extend the path===
<code><br />export PATH=$HOME/development/qnx/qt5/bin:$PATH<br /></code>


On Linux or OS X
On Windows&amp;gt;


On Windows&gt;
<code><br />C:&gt; set PATH=C:stall\bin;PATH<br /></code>


===Build and install additional git submodules===
=== Build and install additional git submodules ===


On Linux or OS X:
On Linux or OS X:
<code><br />cd &lt;sub_module_name&amp;gt;<br />qmake<br />make -j&amp;lt;N&amp;gt;<br />make install<br /></code>


On Windows:
On Windows:


==How to use this build==
<code><br />C:&gt; cd &lt;sub_module_name&amp;gt;<br />C:&gt; qmake<br />C:&gt; mingw32-make -j<br />C:&gt; mingw32-make -j install<br /></code>
 
You next reading should be [[Custom Qt on BlackBerry devices|Using custom Qt builds on BlackBerry 10 devices]]. It will explain how configure Qt Creator with the new build and how to use it in application development.
 
If you are interested about the similar steps related to Qt4, you should read [[Building-Qt4-for-Blackberry|Building Qt4 for Blackberry]]. Optionally you can also build QtWebKit, see [[Building-QtWebKit-for-Blackberry|Building QtWebKit for Blackberry]]. Please keep in mind that this is not supported by BlackBerry.


===Categories:===
== How to use this build ==


* [[:Category:BlackBerry|BlackBerry]]
You next reading should be [[Custom_Qt_on_BlackBerry_devices | Using custom Qt builds on BlackBerry 10 devices ]]. It will explain how configure Qt Creator with the new build and how to use it in application development.
* [[:Category:Developing with Qt|Developing_with_Qt]]
** [[:Category:Developing with Qt::Qt-5|Qt 5]]
* [[:Category:HowTo|HowTo]]

Revision as of 11:00, 24 February 2015



[toc align_right="yes&quot; depth="2&quot;]

Building Qt5 for BlackBerry

This page provides instructions on how to build Qt5 for BlackBerry 10 and the Playbook OS. Please note that the work is currently focused on Qt5 for BlackBerry 10. Qt5 might not build or not run well on the PlayBook OS, whereas Qt v5.1.1 is known to build and work with some potential issues when executing an application on Playbook.

Setting up the environment

See Setup for BlackBerry10 development for the introduction and further instructions.

Getting the source

We do an in-source build of the Qt5 repositories that are needed and install them into dedicated build directory. <code&gt;$HOME/development/qnx/qt5&lt;code&gt; is used in the examples below. Please also note that we clone and build git submodules separately. This procedure is different to the builds for desktop platforms and allows to include only those submodules which are relevant without managing a master repository. Please adjust the paths to suit your setup as needed.

First create a directory to hold the source code:

<br />cd $HOME/development<br />mkdir qt5<br />cd qt5<br />

The following repositories are used in regular builds for BlackBerry 10 in "BlackBerry's public CI&quot;:http://qtlab.blackberry.com as of Qt 5.2 :

  1. qtbase
  2. qtdeclarative
  3. qtmultimedia
  4. qtgraphicaleffects
  5. qtconnectivity
  6. qtxmlpatterns
  7. qtsensors
  8. qtquickcontrols

This matches all essential modules, plus several add-on modules. QtWebKit is currently not a part of the regular builds. Still, it is possible to build it, see Building-QtWebKit-for-Blackberry

Other repositories known to build:

  1. qtjsbackend (not relevant anymore for Qt 5.2 and later)
  2. qt3d (optional, provides 3D scenes using QML)
  3. qtscript (optional, only needed when using the qtquick1 submodule)
  4. qtlocation

Then clone:

<br />git clone git://gitorious.org/qt/qtbase.git<br />git clone git://gitorious.org/qt/qtxmlpatterns.git<br />git clone git://gitorious.org/qt/qtsensors.git<br />git clone git://gitorious.org/qt/qtdeclarative.git<br />git clone git://gitorious.org/qt/qtmultimedia.git<br />git clone git://gitorious.org/qt/qtgraphicaleffects.git<br />git clone git://gitorious.org/qt/qtconnectivity.git<br />git clone git://gitorious.org/qt/qtquickcontrols.git

Using the master repository

The presented approach handles repositories from related Qt5 modules separately. If you prefer, you can also adapt the standard procedure based on a build from the master repository. You just need to make sure that your master repository has been initialized for those repositories which are actually supported on BlackBerry 10. The following can be used to initialize the master repository for the Qt modules out lined above:

<br />./init-repository -f no-webkit module-subset=qtbase,qtxmlpatterns,qtdeclarative,qtsensors,qtmultimedia,qtgraphicaleffects,qtconnectivity,qtquickcontrols,qtlocation

Building

The process of building Qt5 for BlackBerry devices is very similar to building it for any other platform so it is worth having a quick read through the generic instructions for building Qt5 before proceeding.

Be sure that you have configured your environment to use the BlackBerry 10 NDK as described in Blackberry. This especially concerns setting the right values in $PATH to pickup tools and the cross-compile tool-chain provided in the NDK.

Note

When building Qt5 with the latest public NDK some features might be disabled (Input Method Framework, LGMON, NFC Share). This is due to missing header files which have not been published yet.

The "configure&quot; step

First we need to configure Qt.

Linux/OS X

The examples below show a minimal set of configure options. You can see the full set of configure options used in the "BlackBerry's public CI&quot;:http://qtlab.blackberry.com in the raw console output of the

qtbase<code> build. See &quot;this link&amp;quot;:http://qtlab.blackberry.com/job/qt-5-qtbase-stable/ and then open the raw &quot;Console Output&amp;quot; for the last successful build for ARM or for x86.


cd qtbase
./configure -prefix $HOME/development/qnx/qt5 -xplatform blackberry-armle-v7-qcc -opengl es2 -nomake examples -nomake tests -opensource -confirm-license -release

When compiling for the PlayBook, use the following command:


./configure -prefix $HOME/development/qnx/qt5 -device blackberry-playbook-armle-v7 -opengl es2 -nomake examples -nomake tests -opensource -confirm-license -release -no-neon

And afterwards we simply build it by calling &lt;code&amp;gt;make&amp;lt;code&amp;gt; and &lt;code&amp;gt;make install&amp;lt;code&amp;gt;:


make -j&lt;N&gt;
make install

where &lt;N&amp;gt; is the number of parallel make jobs to run. Usually, this is set to &lt;No. of CPU cores + 1&amp;gt;.

=== Windows ===


C:> cd qtbase
C:> configure -prefix C:stall -xplatform blackberry-armle-v7-qcc -opengl es2 -nomake examples -nomake tests -opensource -confirm-license -release

For the PlayBook:


C:> cd qtbase
C:> configure -prefix C:stall -device blackberry-playbook-armle-v7 -opengl es2 -nomake examples -nomake tests -opensource -confirm-license -release -no-c+11 -no-pps

<br />And afterwards we simply build it by calling mingw32-make and mingw32-make install.
<br />


mingw32-make -j
mingw32-make install

<br />If you want to work with the HTTPS protocol, add '''-openssl''' option. ''need to check if the same is required on Linux''
<br />h3. Mac OS X
<br />This is almost the same as on Linux. We just add

-no-c11 option when compiling on Mac OSX, since the current version of the toolchain does not support c11.

<br />$ cd qtbase<br />$ ./configure -prefix $HOME/development/qnx/qt5 -xplatform blackberry-armle-v7-qcc -opengl es2 -nomake examples -nomake tests -opensource -confirm-license -release -no-neon -no-c''+11<br />

The actual "build&quot; step

After above steps have been completed you should have QtBase installed in the prefix directory (i.e. in $HOME/development/qnx/qt5 or in C:stall, depending on your operating system).

In order to complete build, we go through all modules and build them as "regular&quot; Qt projects, but use use the <code&gt;qmake&lt;code&gt; from our new Qt5 installation (i.e. from the prefix directory). A few modules have dependencies to each other. Make sure you build modules in the order as listed above.

Extend the path

On Linux or OS X

<br />export PATH=$HOME/development/qnx/qt5/bin:$PATH<br />

On Windows&gt;

<br />C:&gt; set PATH=C:stall\bin;PATH<br />

Build and install additional git submodules

On Linux or OS X:

<br />cd &lt;sub_module_name&amp;gt;<br />qmake<br />make -j&amp;lt;N&amp;gt;<br />make install<br />

On Windows:

<br />C:&gt; cd &lt;sub_module_name&amp;gt;<br />C:&gt; qmake<br />C:&gt; mingw32-make -j<br />C:&gt; mingw32-make -j install<br />

How to use this build

You next reading should be Using custom Qt builds on BlackBerry 10 devices . It will explain how configure Qt Creator with the new build and how to use it in application development.