C
CMake manual for NXP boards
The CMake build tool simplifies the build process for development projects. It automatically generates build systems, such as Makefiles and Visual Studio project files.
CMake is a third-party tool with its own documentation. This topic describes how to use CMake with Qt Quick Ultralite when developing applications for NXP boards.
QUL_ROOT
and QUL_TOOLS
are used in the command line examples below as if they were set as environment variables. For example:
export QUL_ROOT=$HOME/Qt/QtMCUs/2.9.0 export QUL_TOOLS=$HOME/Qt/Tools/QtMCUs
set QUL_ROOT=C:\Qt\QtMCUs\2.9.0 set QUL_TOOLS=C:\Qt\Tools\QtMCUs
Build configuration
Configure the following CMake variables when developing applications for NXP boards.
Variable | Value |
---|---|
Qul_ROOT | Set the Qul_ROOT to the Qt for MCUs SDK install path.
-DQul_ROOT=$QUL_ROOT -DQul_ROOT=%QUL_ROOT% Note: This CMake variable is intentionally mixed-case since it needs to match the package name. |
QUL_PLATFORM | The platform name must indicate the board and the OS you want to target. It's a combination of the chosen board's name and the OS you are targeting. The platform name in the following example indicates that your target is MIMXRT1050-EVK on baremetal .-DQUL_PLATFORM=mimxrt1050-evk-baremetal Note: If you want to target another board or OS, refer to Supported platforms for more information. |
FREERTOS_DIR | Absolute path to the FreeRTOS sources directory. It is required for FreeRTOS targets only. Refer to FreeRTOS platforms for more information about boards on FreeRTOS.-DFREERTOS_DIR=< FreeRTOS directory path > |
CMAKE_TOOLCHAIN_FILE | As an example for the BareMetal and FreeRTOS targets, set it to the Arm GCC toolchain configuration file:
-DCMAKE_TOOLCHAIN_FILE=$QUL_ROOT/lib/cmake/Qul/toolchain/armgcc.cmake -DCMAKE_TOOLCHAIN_FILE=%QUL_ROOT%\lib\cmake\Qul\toolchain\armgcc.cmake For the MCIMX93-EVK Linux target, set it to the -DCMAKE_TOOLCHAIN_FILE=$HOME/Qt/6.6.3/Boot2Qt/imx93-11x11-lpddr4x-evk/toolchain/sysroots/x86_64-pokysdk-linux/usr/lib/cmake/Qt6/qt.toolchain.cmake -DCMAKE_TOOLCHAIN_FILE=C:\Qt\6.6.3\Boot2Qt\imx93-11x11-lpddr4x-evk\toolchain\sysroots\x86_64-w64-mingw32\usr\lib\cmake\Qt6\qt.toolchain.cmake |
QT_TOOLCHAIN_INCLUDE_FILE | For the MCIMX93-EVK Linux target, set QT_TOOLCHAIN_INCLUDE_FILE to the boot2qt.cmake file from the Qt for MCUs SDK install path.
-DQT_TOOLCHAIN_INCLUDE_FILE=$QUL_ROOT/lib/cmake/Qul/toolchain/boot2qt.cmake -DQT_TOOLCHAIN_INCLUDE_FILE=%QUL_ROOT%/lib/cmake/Qul/toolchain/boot2qt.cmake |
QUL_TARGET_TOOLCHAIN_DIR | For non-Linux targets, use the QUL_TARGET_TOOLCHAIN_DIR CMake cache entry to provide the location of the used toolchain.
-DQUL_TARGET_TOOLCHAIN_DIR=/path/to/the/toolchain -DQUL_TARGET_TOOLCHAIN_DIR=C:\path\to\the\toolchain |
QUL_BOARD_SDK_DIR | For non-Linux targets, set QUL_BOARD_SDK_DIR to the appropriate board SDK. For example, set it to the MIMXRT1050-EVKB SDK install path:
-DQUL_BOARD_SDK_DIR=$QUL_TOOLS/NXP/SDK_<version>_EVKB-IMXRT1050 -DQUL_BOARD_SDK_DIR=%QUL_TOOLS%\NXP\SDK_<version>_EVKB-IMXRT1050 |
QUL_COLOR_DEPTH | The color depth supported by the platform you have chosen. For example, set it to 16-bit.-DQUL_COLOR_DEPTH=16 Note: If this variable is not set, default color depth is used while configuring for the platform. |
MCUXPRESSO_IDE_PATH | For non-Linux targets, set the MCUXPRESSO_IDE_PATH CMake cache entry to your MCUXpresso IDE installation path.Flash targets are created if the NXP_Flash_tool is found under |
Note: In a Qt Quick Ultralite project, CMAKE_BUILD_TYPE
is set to MinSizeRel
by default. MinSizeRel
is the build type used for the prebuilt platform libraries shipped with Qt Quick Ultralite. To change the build type (to Release
for example), invoke CMake with the -DCMAKE_BUILD_TYPE=Release
option. For more information, see CMAKE_BUILD_TYPE.
Available under certain Qt licenses.
Find out more.