Building Qt for QNX Neutrino OS: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
(Simplify punctuation)
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
=Building Qt for <span class="caps">QNX</span> Neutrino OS=
{{LangSwitch}}
[[Category:QNX]]
== Setting up the environment ==


==Setting up the environment==
After installing the [[QNX_Platform|required software]] you need to source the qnx environment script:


After installing the [[QNX Platform|required software]] you need to source the qnx environment script:
<code>source <SDP_DIRECTORY>/qqnx660-env.sh</code>


==Get the sources==
== Get the sources ==


There are two ways how to get a copy of the Qt’s source code:
There are two ways how to get a copy of the Qt's source code:
 
# Download an archive of a released version (see the folder <<release-nr>/single> [http://download.qt.io/official_releases/qt/ this link] for open source releases or check your Qt Account to copy a commercial release, if you have Qt Enterprise license for QNX)
# Download an archive of a released version (see the folder &lt;&lt;release-nr&gt;/single&gt; [http://download.qt.io/official_releases/qt/ this link] ''[download.qt.io]'' for open source releases or check your Qt Account to copy a commercial release, if you have Qt Enterprise license for <span class="caps">QNX</span>)
# Clone Qt git repository and
# Clone Qt git repository and
## use the master repository to build and all required submodules in one run
## use the master repository to build and all required submodules in one run
Line 16: Line 17:
The first way is a good choice if you just like to use a last released version of the source code. If you like to get any changes before an official release, you have to clone the source code from git.
The first way is a good choice if you just like to use a last released version of the source code. If you like to get any changes before an official release, you have to clone the source code from git.


All Qt Essential modules (excluding QtWebKit) and some of the add-on modules are supported on <span class="caps">QNX</span> (for a complete list, [[Qt Status on QNX|visit this page]]). In the below build process, every module should be cloned individually. Make sure that you clone/build/use only the modules which are known to work on <span class="caps">QNX</span>.
All Qt Essential modules (excluding QtWebKit) and some of the add-on modules are supported on QNX (for a complete list, [[Qt_Status_on_QNX|visit this page]]). In the below build process, every module should be cloned individually. Make sure that you clone/build/use only the modules which are known to work on QNX.


This procedure building separate modules one by one is different to standard one where one master repository is used, but provides a better overview what is build and installed.
This procedure building separate modules one by one is different to standard one where one master repository is used, but provides a better overview what is build and installed.
Line 22: Line 23:
Clone the following submodule repositories in a new folder:
Clone the following submodule repositories in a new folder:


Note: the above list corresponds to the list of modules supported on <span class="caps">QNX</span>. A few additional git submodules are used in regular builds to support the Qt toolchain and localizations process: qtscript, qttranslations, qttools, qtdoc
<code>git clone git://code.qt.io/qt/qtbase.git
git clone git://code.qt.io/qt/qtxmlpatterns.git
git clone git://code.qt.io/qt/qtdeclarative.git
git clone git://code.qt.io/qt/qtmultimedia.git
git clone git://code.qt.io/qt/qtgraphicaleffects.git
git clone git://code.qt.io/qt/qtquickcontrols.git
git clone git://code.qt.io/qt/qtsvg.git
git clone git://code.qt.io/qt/qtimageformats.git
</code>


The alternative way with cloning the source code from the Qt’s master repository for a build for <span class="caps">QNX</span> is the same as documented in the [[Building Qt 5 from Git|generic instructions for building Qt5]]. You just have to make sure that you initialize only those modules which you need and which are supported and make sure you skip “qtwebkit”, unless you know how to build it for <span class="caps">QNX</span>:
Note: the above list corresponds to the list of modules supported on QNX. A few additional git submodules are used in regular builds to support the Qt toolchain and localizations process: qtscript, qttranslations, qttools, qtdoc
 
The alternative way with cloning the source code from the Qt's master repository for a build for QNX is the same as documented in the [[Building_Qt_5_from_Git | generic instructions for building Qt5]]. You just have to make sure that you initialize only those modules which you need and which are supported and make sure you skip "qtwebkit", unless you know how to build it for QNX:
 
<code>
./init-repository —no-webkit —module-subset=qtbase,qtxmlpatterns,qtdeclarative,qtmultimedia,qtgraphicaleffects,qtquickcontrols,qtsvg,qtimageformats
</code>


If you use an archive with Qt5 source code you can proceed to the next steps : configuring the build.
If you use an archive with Qt5 source code you can proceed to the next steps : configuring the build.


==Configure and building QtBase==
== Configure and building QtBase ==


Configuring and building Qt 5 for <span class="caps">QNX</span> is very similar to other platforms so it is worth having a quick read through [[Building Qt 5 from Git|generic instructions for building Qt5]] and take a look on the [[Building-Qt5-for-Blackberry|Build Instructions for BlackBerry 10]] before proceeding.
Configuring and building Qt 5 for QNX is very similar to other platforms so it is worth having a quick read through [[Building_Qt_5_from_Git | generic instructions for building Qt5]] and take a look on the [[Building-Qt5-for-Blackberry|Build Instructions for BlackBerry 10]] before proceeding.


When running configure, the “xplatform” parameter has to be passed to the script. The value of this parameter for <span class="caps">QNX</span> is “qnx-armle-v7-qcc” for '''arm''' builds and “qnx-x86-qcc” for '''×86''' builds. You can configure and make a build only for one target in one run.
When running configure, the "xplatform" parameter has to be passed to the script. The value of this parameter for QNX is "qnx-armle-v7-qcc" for '''arm''' builds and "qnx-x86-qcc" for '''x86''' builds. You can configure and make a build only for one target in one run.


If you cloned separate modules from git, you have to change into the folder with the QtBase module and run “configure” from there. If you have cloned Qt5 master repository, or use an archive with all Qt5 sources, you use the configure located in the root folder of the Qt source code base.
If you cloned separate modules from git, you have to change into the folder with the QtBase module and run "configure" from there. If you have cloned Qt5 master repository, or use an archive with all Qt5 sources, you use the configure located in the root folder of the Qt source code base.


Building with the install prefix -prefix” is highly recommended. The prefix parameter should be set to the location where Qt will be installed on the host.
Building with the install prefix "-prefix" is highly recommended. The prefix parameter should be set to the location where Qt will be installed on the host.


===Linux===
=== Linux ===


On Linux and Mac the “configure” shell script has to be executed.
On Linux and Mac the "configure" shell script has to be executed.


If you do very frequent builds you can also add -confirm-license” and pre-select the type of license your are using with e.g. -opensource”. This will let configure just run and not ask any questions on the console.
<code>./configure -prefix <INSTALLFOLDER> -xplatform qnx-armle-v7-qcc</code>
 
If you do very frequent builds you can also add "-confirm-license" and pre-select the type of license your are using with e.g. "-opensource". This will let configure just run and not ask any questions on the console.


Note that this are minimal required configure options. Other options can be used as well, e.g. to shorted the build time by exclusion of tests or examples, etc.
Note that this are minimal required configure options. Other options can be used as well, e.g. to shorted the build time by exclusion of tests or examples, etc.


If you build modules separately, QtBase can simply be built by executing
If you build modules separately, QtBase can simply be built by executing
<code>make -j<N>
make install
</code>


The same command will make and install in the entire Qt with other choices
The same command will make and install in the entire Qt with other choices


===Windows===
=== Windows ===


The steps for Linux are valid for Windows, considering the well-known platform differences. There are no <span class="caps">QNX</span> specific differences in building on Windows.
The steps for Linux are valid for Windows, considering the well-known platform differences. There are no QNX specific differences in building on Windows.


==Building other modules==
== Building other modules ==


If you build modules separately, you should now have the QtBase module installed in the &lt;<span class="caps">INSTALLFOLDER</span>&gt; directory. In order to build the other Qt modules, you should just go through all git repositories you cloned as above and build them as “regular” Qt projects. Make sure that you use “qmake” from the QtBase module you just have built and installed (i.e. from the &lt;<span class="caps">INSTALLFOLDER</span>&gt;/bin directory) and not the one you might have in $PATH.
If you build modules separately, you should now have the QtBase module installed in the <INSTALLFOLDER> directory. In order to build the other Qt modules, you should just go through all git repositories you cloned as above and build them as "regular" Qt projects. Make sure that you use "qmake" from the QtBase module you just have built and installed (i.e. from the <INSTALLFOLDER>/bin directory) and not the one you might have in $PATH.


Some modules have dependencies to others (e.g. QtQuickControls depend on QtQuick to be built and installed). If built in the wrong order the results might be build errors or disabled features. So it is recommended to build the modules in the order as listed above.
Some modules have dependencies to others (e.g. QtQuickControls depend on QtQuick to be built and installed). If built in the wrong order the results might be build errors or disabled features. So it is recommended to build the modules in the order as listed above.


===Use the build===
=== Use the build ===
 
See the page [[QNX-App-development-and-deployment|Qt application development and deployment on <span class="caps">QNX</span>]] to learn how to use this build for development.
 
==Pre-Built Binaries==
 
Binary installers for <span class="caps">QNX</span> are available with commercially licensed [http://qt.digia.com/Products/Qt-Enterprise-Embedded/RTOS/ Qt Enterprise] ''[qt.digia.com]''.
 
[http://qt.digia.com/About-Us/Contact-Us/ Contact Digia to get Qt Enterprise evaluation for <span class="caps">QNX</span>] ''[qt.digia.com]''.
 
===Categories:===


* [[:Category:QNX|QNX]]
See the page [[QNX-App-development-and-deployment|Qt application development and deployment on QNX]] to learn how to use this build for development.

Latest revision as of 13:20, 23 August 2015

En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh

Setting up the environment

After installing the required software you need to source the qnx environment script:

source <SDP_DIRECTORY>/qqnx660-env.sh

Get the sources

There are two ways how to get a copy of the Qt's source code:

  1. Download an archive of a released version (see the folder <<release-nr>/single> this link for open source releases or check your Qt Account to copy a commercial release, if you have Qt Enterprise license for QNX)
  2. Clone Qt git repository and
    1. use the master repository to build and all required submodules in one run
    2. build and install QtBase and then build submodules one by one as separate projects

The first way is a good choice if you just like to use a last released version of the source code. If you like to get any changes before an official release, you have to clone the source code from git.

All Qt Essential modules (excluding QtWebKit) and some of the add-on modules are supported on QNX (for a complete list, visit this page). In the below build process, every module should be cloned individually. Make sure that you clone/build/use only the modules which are known to work on QNX.

This procedure building separate modules one by one is different to standard one where one master repository is used, but provides a better overview what is build and installed.

Clone the following submodule repositories in a new folder:

git clone git://code.qt.io/qt/qtbase.git
git clone git://code.qt.io/qt/qtxmlpatterns.git
git clone git://code.qt.io/qt/qtdeclarative.git
git clone git://code.qt.io/qt/qtmultimedia.git
git clone git://code.qt.io/qt/qtgraphicaleffects.git
git clone git://code.qt.io/qt/qtquickcontrols.git
git clone git://code.qt.io/qt/qtsvg.git
git clone git://code.qt.io/qt/qtimageformats.git

Note: the above list corresponds to the list of modules supported on QNX. A few additional git submodules are used in regular builds to support the Qt toolchain and localizations process: qtscript, qttranslations, qttools, qtdoc

The alternative way with cloning the source code from the Qt's master repository for a build for QNX is the same as documented in the generic instructions for building Qt5. You just have to make sure that you initialize only those modules which you need and which are supported and make sure you skip "qtwebkit", unless you know how to build it for QNX:

./init-repository no-webkit module-subset=qtbase,qtxmlpatterns,qtdeclarative,qtmultimedia,qtgraphicaleffects,qtquickcontrols,qtsvg,qtimageformats

If you use an archive with Qt5 source code you can proceed to the next steps : configuring the build.

Configure and building QtBase

Configuring and building Qt 5 for QNX is very similar to other platforms so it is worth having a quick read through generic instructions for building Qt5 and take a look on the Build Instructions for BlackBerry 10 before proceeding.

When running configure, the "xplatform" parameter has to be passed to the script. The value of this parameter for QNX is "qnx-armle-v7-qcc" for arm builds and "qnx-x86-qcc" for x86 builds. You can configure and make a build only for one target in one run.

If you cloned separate modules from git, you have to change into the folder with the QtBase module and run "configure" from there. If you have cloned Qt5 master repository, or use an archive with all Qt5 sources, you use the configure located in the root folder of the Qt source code base.

Building with the install prefix "-prefix" is highly recommended. The prefix parameter should be set to the location where Qt will be installed on the host.

Linux

On Linux and Mac the "configure" shell script has to be executed.

./configure -prefix <INSTALLFOLDER> -xplatform qnx-armle-v7-qcc

If you do very frequent builds you can also add "-confirm-license" and pre-select the type of license your are using with e.g. "-opensource". This will let configure just run and not ask any questions on the console.

Note that this are minimal required configure options. Other options can be used as well, e.g. to shorted the build time by exclusion of tests or examples, etc.

If you build modules separately, QtBase can simply be built by executing

make -j<N>
make install

The same command will make and install in the entire Qt with other choices

Windows

The steps for Linux are valid for Windows, considering the well-known platform differences. There are no QNX specific differences in building on Windows.

Building other modules

If you build modules separately, you should now have the QtBase module installed in the <INSTALLFOLDER> directory. In order to build the other Qt modules, you should just go through all git repositories you cloned as above and build them as "regular" Qt projects. Make sure that you use "qmake" from the QtBase module you just have built and installed (i.e. from the <INSTALLFOLDER>/bin directory) and not the one you might have in $PATH.

Some modules have dependencies to others (e.g. QtQuickControls depend on QtQuick to be built and installed). If built in the wrong order the results might be build errors or disabled features. So it is recommended to build the modules in the order as listed above.

Use the build

See the page Qt application development and deployment on QNX to learn how to use this build for development.