C

Building Qt Quick Ultralite from sources

This topic provides instructions to build the full Qt Quick Ultralite from sources, or only the platform library against the Qt Quick Ultralite evaluation packages.

Prerequisites

  • Qt for MCUs SDK
  • Qt Creator v6.0.0 or newer
  • CMake 3.15 or newer
  • Ninja 1.10.0 or newer

    Note: Ensure that you have also installed all the prerequisites listed in the getting started section for your specific board.

Command line setup

To get started from the command line, ensure that the following environment variables are set:

  • Add the CMake and Ninja tools to your system PATH. If you installed these tools using the Qt online installer, they are installed under <QT_INSTALL_PATH>\Tools.

Note: This page uses QUL_ROOT and QUL_TOOLS in command line examples as if they were set as environment variables. They could be set for example:

export QUL_ROOT=$HOME/Qt/QtMCUs/2.0.0
export QUL_TOOLS=$HOME/Qt/Tools/QtMCUs
set QUL_ROOT=C:\Qt\QtMCUs\2.0.0
set QUL_TOOLS=C:\Qt\Tools\QtMCUs

Building Qt Quick Ultralite from sources

If your license provides access to the Qt Quick Ultralite sources, use these commands to build it. For example, the following builds Qt Quick Ultralite for NXP i.MX RT1050 on bare metal:

cd $QUL_ROOT
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../lib/cmake/Qul/toolchain/armgcc.cmake -DQUL_TARGET_TOOLCHAIN_DIR=$QUL_TOOLS/arm_gcc_9 -DQUL_BOARD_SDK_DIR=$QUL_TOOLS/NXP/SDK_2.10.0_EVKB_IMXRT1050 -DQUL_GENERATORS=../lib/cmake/Qul/QulGenerators.cmake -DQUL_PLATFORM=MIMXRT1050-EVK-baremetal
cmake --build .
cd %QUL_ROOT%
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=..\lib\cmake\Qul\toolchain\armgcc.cmake -DQUL_TARGET_TOOLCHAIN_DIR=%QUL_TOOLS%\arm_gcc_9 -DQUL_BOARD_SDK_DIR=%QUL_TOOLS%\NXP\SDK_2.10.0_EVKB_IMXRT1050 -DQUL_GENERATORS=..\lib\cmake\Qul\QulGenerators.cmake -DQUL_PLATFORM=MIMXRT1050-EVK-baremetal
cmake --build .

To build for a different hardware platform, update the CMAKE_TOOLCHAIN_FILE and QUL_PLATFORM CMake variables accordingly. The value for the QUL_PLATFORM variable must be a combination of <BOARD-NAME> and <OS>. The following is a list of all the possible values that you can use:

  • TVIIC2D6M-baremetal
  • EK-RA6M3G-baremetal
  • MIMXRT1050-EVK-baremetal
  • MIMXRT1050-EVK-freertos
  • MIMXRT1060-EVK-baremetal
  • MIMXRT1064-EVK-baremetal
  • MIMXRT1064-EVK-freertos
  • MIMXRT1170-EVK-freertos
  • RH850-D1M1A-baremetal
  • STM32F769I-DISCOVERY-baremetal
  • STM32F769I-DISCOVERY-freertos
  • STM32H750B-DISCOVERY-baremetal
  • STM32F469I-DISCOVERY-baremetal

Note: The value for CMAKE_TOOLCHAIN_FILE can be for GreenHills, IAR, or Arm GCC as shown in the earlier example.

Once Qt Quick Ultralite is built successfully, build one of the supported demos/examples using it and flash the resulting binary to the target hardware.

cmake --build . --target flash_<DEMO_OR_EXAMPLE_NAME>

Where, DEMO_OR_EXAMPLE_NAME is the name of a supported demo or an example.

Note: You can also use the flash_<DEMO_OR_EXAMPLE_NAME>_and_bootloader target to flash the bootloader with the demo/example.

Building Qt Quick Ultralite platform library against the evaluation packages

With the evaluation version of Qt Quick Ultralite you can modify and rebuild the platforms that are already shipped together with Qt Quick Ultralite. For example, port to a slightly different board configuration.

For instructions on how to create your own platform library for a custom hardware platform, refer to the Qt Quick Ultralite Platform Porting Guide.

Note: We recommend you to take backup of your existing Qt for MCUs version that is being used, before modifying the sources or installing a custom built platform library. This approach enables you to restore the original version in case there are issues with the custom-built version.

The following commands build the Qt Quick Ultralite platform library for NXP i.MX RT1050 on bare metal:

cd $QUL_ROOT
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../lib/cmake/Qul/toolchain/armgcc.cmake -DQUL_TARGET_TOOLCHAIN_DIR=$QUL_TOOLS/arm_gcc_9 -DQUL_BOARD_SDK_DIR=$QUL_TOOLS/NXP/SDK_2.10.0_EVKB_IMXRT1050 -DQUL_PLATFORM=MIMXRT1050-EVK-baremetal -DQUL_BUILD_DEMOS=off -DQUL_BUILD_EXAMPLES=off -DQUL_BUILD_FRAMEWORK=off
cmake --build .
cd %QUL_ROOT%
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=..\lib\cmake\Qul\toolchain\armgcc.cmake -DQUL_TARGET_TOOLCHAIN_DIR=%QUL_TOOLS%\arm_gcc_9 -DQUL_BOARD_SDK_DIR=%QUL_TOOLS%\NXP\SDK_2.10.0_EVKB_IMXRT1050 -DQUL_PLATFORM=MIMXRT1050-EVK-baremetal -DQUL_BUILD_DEMOS=off -DQUL_BUILD_EXAMPLES=off -DQUL_BUILD_FRAMEWORK=off
cmake --build .

To update the Qt Creator integration to use the custom built platform library, set these two environment variables:

  • CMAKE_INSTALL_PREFIX to Qt for MCUs install directory. It should match the Qt for MCUs version set in the Tools > Options > Devices > MCU option in Qt Creator.
  • QUL_VERSION to the corresponding version number. For example, if Qt Creator is configured to use C:\Qt\QtMCUs\<VERSION>, where <VERSION> is the directory containing the Qt Quick Ultralite version you are using (for example 2.0).

After setting these variables, use the following commands to configure and install the platform library:

export QUL_VERSION=<VERSION>
cd $QUL_ROOT
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../lib/cmake/Qul/toolchain/armgcc.cmake -DQUL_PLATFORM=MIMXRT1050-EVK-baremetal -DQUL_TARGET_TOOLCHAIN_DIR=$QUL_TOOLS/arm_gcc_9 -DQUL_BOARD_SDK_DIR=$QUL_TOOLS/NXP/SDK_2.10.0_EVKB_IMXRT1050 -DQUL_BUILD_DEMOS=off -DQUL_BUILD_EXAMPLES=off -DQUL_BUILD_FRAMEWORK=off -DCMAKE_INSTALL_PREFIX=$QUL_SDK_PATH -DQUL_VERSION=$QUL_VERSION
cmake --build .
cmake --install .
set QUL_VERSION=<VERSION>
cd %QUL_ROOT%
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=..\lib\cmake\Qul\toolchain\armgcc.cmake -DQUL_PLATFORM=MIMXRT1050-EVK-baremetal -DQUL_TARGET_TOOLCHAIN_DIR=%QUL_TOOLS%\arm_gcc_9 -DQUL_BOARD_SDK_DIR=%QUL_TOOLS%\NXP\SDK_2.10.0_EVKB_IMXRT1050 -DQUL_BUILD_DEMOS=off -DQUL_BUILD_EXAMPLES=off -DQUL_BUILD_FRAMEWORK=off -DCMAKE_INSTALL_PREFIX=%QUL_SDK_PATH% -DQUL_VERSION=%QUL_VERSION%
cmake --build .
cmake --install .

Building applications out-of-source using a custom built Qt Quick Ultralite

This section describes how to build an application out-of-source, using a custom-built Qt Quick Ultralite.

The following step-by-step instructions help you build and install Qt Quick Ultralite, and use it to build an application:

  1. Set up your development environment for the choosen target as per the instructions in the relevant Getting Started topic.
  2. Build Qt Quick Ultralite from the modified sources and install it to a custom location. If you built and installed the platform library as described in the previous section, you can skip this part.
    mkdir some\path\custom_builds\qul
    cd some\path\custom_builds\qul
    
    mkdir qul-build
    cd qul-build
    
    cmake $QUL_ROOT -G "Ninja" -DCMAKE_INSTALL_PREFIX=/some/path/custom_builds/qul -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$QUL_ROOT/lib/cmake/Qul/toolchain/armgcc.cmake -DQUL_TARGET_TOOLCHAIN_DIR=$QUL_TOOLS/arm_gcc_9 -DQUL_PLATFORM=<PLATFORM_NAME> -DQUL_BUILD_TESTS=OFF -DQUL_BUILD_DEMOS=OFF -DQUL_BUILD_EXAMPLES=OFF -DQUL_GENERATORS=$QUL_ROOT/lib/cmake/Qul/QulGenerators.cmake
    
    ninja install
    mkdir some\path\custom_builds\qul
    cd some\path\custom_builds\qul
    
    mkdir qul-build
    cd qul-build
    
    cmake %QUL_ROOT% -G "Ninja" -DCMAKE_INSTALL_PREFIX=some\path\custom_builds\qul -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=%QUL_ROOT%\lib\cmake\Qul\toolchain\armgcc.cmake -DQUL_TARGET_TOOLCHAIN_DIR=%QUL_TOOLS%\arm_gcc_9 -DQUL_PLATFORM=<PLATFORM_NAME> -DQUL_BUILD_TESTS=OFF -DQUL_BUILD_DEMOS=OFF -DQUL_BUILD_EXAMPLES=OFF -DQUL_GENERATORS=%QUL_ROOT%\lib\cmake\Qul\QulGenerators.cmake
    
    ninja install
  3. Use the custom-built Qt Quick Ultralite to build your application, which is not part of the Qt Quick Ultralite source tree:
    cd /some/path/custom_builds
    mkdir app # Put your application here. You can use the minimal example from the SDK.
    cd app
    mkdir build
    cd build
    
    cmake .. -G "Ninja" -DQul_ROOT=$QUL_ROOT -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$QUL_ROOT/lib/cmake/Qul/toolchain/armgcc.cmake -DQUL_TARGET_TOOLCHAIN_DIR=$QUL_TOOLS/arm_gcc_9 -DQUL_GENERATORS=$QUL_ROOT/lib/cmake/Qul/QulGenerators.cmake -DQUL_PLATFORM=<PLATFORM_NAME>
    
    ninja
    ninja flash_<YOUR_APP_NAME>
    cd some\path\custom_builds
    mkdir app # Put your application here. You can use the minimal example from the SDK.
    cd app
    mkdir build
    cd build
    
    cmake .. -G "Ninja" -DQul_ROOT=%QUL_ROOT% -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=%QUL_ROOT%\lib\cmake\Qul\toolchain\armgcc.cmake -DQUL_TARGET_TOOLCHAIN_DIR=%QUL_TOOLS%\arm_gcc_9 -DQUL_GENERATORS=%QUL_ROOT%\lib\cmake\Qul\QulGenerators.cmake -DQUL_PLATFORM=<PLATFORM_NAME>
    
    ninja
    ninja flash_<YOUR_APP_NAME>

Available under certain Qt licenses.
Find out more.