IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Building Qt for QNX

Describes required packages and necessary configuration for building.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Setting up QNX SDP

Building Qt 6 requires downloading and installing of QNX SDP 7.1 from the QNX website.

A suitable license is required. for more information.

The compiler and other parts of the tool chain are provided in the SDP packages. Initialize your build environment by running the QNX setup script from your SDP installation folder in a terminal, like so:

 
Sélectionnez
source qnxsdp-env.sh

Host build

The cross-compiling Qt requires a host build of Qt being available. During the build, tools such as moc, rcc, qmlcachegen, qsb, are invoked from there. You can either build Qt from sources for the host or install host build using online installer. However, it is advisable to ensure that you can build Qt for the desktop target on the host as well. For more detailed information please see Cross-compiling Qt.

Creating a toolchain file for QNX

To cross-compile a project with CMake a toolchain file is needed. This CMake-language file sets the right values for the platform name, compiler/linker, and many other toolchain-specific things. A minimal toolchain file can be found from CMake documentation:

 
Sélectionnez
set(CMAKE_SYSTEM_NAME QNX)

set(arch gcc_ntoarmv7le)

set(CMAKE_C_COMPILER qcc)
set(CMAKE_C_COMPILER_TARGET ${arch})
set(CMAKE_CXX_COMPILER q++)
set(CMAKE_CXX_COMPILER_TARGET ${arch})

set(CMAKE_SYSROOT $ENV{QNX_TARGET})

The arch variable can be set to either gcc_ntoarmv7le, gcc_ntoaarch64le or gcc_ntox86_64, depending on your target architecture.

Configuring and building Qt for QNX

Assuming the following:

  • The toolchain file is called qnx.cmake and is located in $HOME.

  • The Qt repository checked out, at minimum the qtbase module, under $HOME/qt.

  • A host build of Qt in $HOME/qt-host.

  • The installation location on the local system will be $HOME/qnx-install.

After creating and switching to the build directory run:

 
Sélectionnez
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=$HOME/qnx.cmake  \
-DQT_HOST_PATH=$HOME/qt_host \
-DCMAKE_INSTALL_PREFIX=$HOME/qnx_install \
$HOME/qt

Once configuration completes without errors,build by running:

 
Sélectionnez
cmake --build . --parallel

Once built, run:

 
Sélectionnez
cmake --install .

Which will install the results to $HOME/qnx_install.

You can also configure Qt with the configure tool. Since Qt 6, this tool is a wrapper around CMake.

Third party libraries

Make sure that your system image contains the following additional 3rd-party libraries which are not always included in minimal QNX Neutrino RTOS images:

  • libfontconfig

  • libfreetype

  • libiconv

  • libicui18n

  • libicudata

  • libicuuc

  • libpng14

  • libxml2

  • libsqlite3

  • libssl

  • libcrypto

This is not a complete list of shared libraries used by Qt on QNX Neutrino OS. Multiple shared libraries are already available in a typical OS image, or included by other parts of the system, for example Screen.

See Also

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+