Qt 5.11 | Building Qt for i.MX6 Quad Board

Qt 5.11.3 Reference Documentation

Preparing BSP for i.MX6 Quad Board ◦ Building Monolith Project

# Building Qt for i.MX6 Quad Board

To set up the development environment for Qt for INTEGRITY, you need to build Qt from the sources for the i.MX6 Quad board. Before building Qt, create a shell script that will run the exports for your environment.

## Creating Script for Running Exports

Create a new shell script setEnvironment.sh, and save it under your home folder. Add the following export commands to the script:

      export PATH=$PATH:/usr/ghs/comp_201654
      export INTEGRITY_DIR=/usr/ghs/int1144
      export INTEGRITY_BSP=platform-cortex-a9
      export GL_INC_DIR=/usr/ghs/int1144/INTEGRITY-include/Vivante/sdk/inc
      export GL_LIB_DIR=/usr/ghs/int1144/libs/Vivante

These exports assume you have used the default installation directories while installing MULTI IDE and INTEGRITY (see Installing Platform Dependencies). If you have not used the default directories, you need to adjust the exported paths accordingly.

To initialize your build environment, run the following command in a terminal:

      source ~/setEnvironment.sh

Note: You need to run this command in your terminal every time you build Qt, or use the `qmake` build system.

## Getting Qt Source Code

You can download the Qt source code via your Qt Account.

You can also get the Qt sources via the Git version control system. Qt Wiki has instructions for getting Qt sources via Git, see https://wiki.qt.io/Building_Qt_5_from_Git#Getting_the_source_code. You find the step by step instructions also from Getting Qt Sources via Git.

### Getting Qt Sources via Git

Clone the top-level Qt 5 repository by running the following command in a terminal:

      git clone git://code.qt.io/qt/qt5.git

Note: If you are behind a firewall and want to use the HTTPS protocol, you can clone the top-level Qt 5 repository with the following command:

      git clone https://code.qt.io/qt/qt5.git

Check out the target branch and the Qt sources with the following commands:

      cd qt5
      git checkout <Qt version>
      perl init-repository

For example, the `git checkout` command for Qt 5.9.0 is `git checkout 5.9.0`.

The init-repository script initializes the Qt 5 repository and clones various Qt 5 sub-modules (see https://wiki.qt.io/Building_Qt_5_from_Git#Getting_the_submodule_source_code). Qt modules supported by Qt for INTEGRITY are listed in Supported Qt Modules.

## Configuring Qt

Configure Qt for the i.MX6 Quad board with the following command:

      cd <Qt installation directory>
      ./configure -prefix $PWD/qtbase -xplatform integrity-armv7-imx6 -confirm-license
      -opensource -nomake examples -nomake tests -no-dbus -silent -opengl es2 -static

Note: INTEGRITY supports only static Qt builds.

## Building Qt

Build Qt with the `make` command in the terminal. You can run `make` with as many cores on your host machine as you desire. In our example we use six cores:

      make -j6

## Installing Qt

If you have not used the configure option `-prefix $PWD/qtbase` in Configuring Qt, run the following command in a terminal:

      cd <Qt installation directory>
      make install

If you have used the configure option `-prefix $PWD/qtbase`, you can use Qt from the build directory, without running the `make install` command.

Qt is now configured and built for the i.MX6 Quad board.