This topic explains how to install the new platform port and use it in Qt Creator.
There are two main approaches to build applications against a platform port of Qt Quick Ultralite:
- Build the application against a developer build of the platform port.
- Install the platform port to a self-contained location.
The first one is practical if the port is still being developed, as it helps you test changes quickly against an application.
This page uses
QUL_TOOLS in command line examples as if they were set as environment variables. For example:
export QUL_ROOT=$HOME/Qt/QtMCUs/2.5 export QUL_TOOLS=$HOME/Qt/Tools/QtMCUs
set QUL_ROOT=C:\Qt\QtMCUs\2.5 set QUL_TOOLS=C:\Qt\Tools\QtMCUs
Depending on the used toolchain you have to set
QUL_TARGET_TOOLCHAIN_DIR cmake cache entry needs to be used to provide the location of the used toolchain.
To use nmake, run the "vcvarsx86_amd64.bat" Windows batch file, which is found in the "VC\Auxiliary\Build" Visual Studio directory. Alternatively, you can run "x86_x64 Cross Tools Command Prompt for VS 2017" or the equivalent for your version of Visual Studio.
To build the platform as a developer build, run these commands:
cmake $QUL_ROOT -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=$QUL_TOOLCHAIN_FILE -DQUL_TARGET_TOOLCHAIN_DIR=/path/to/the/toolchain -DQUL_GENERATORS=$QUL_ROOT/lib/cmake/Qul/QulGenerators.cmake -DQUL_PLATFORM=example-baremetal nmake
cmake %QUL_ROOT% -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=%QUL_TOOLCHAIN_FILE% -DQUL_TARGET_TOOLCHAIN_DIR=C:\path\to\the\toolchain -DQUL_GENERATORS=%QUL_ROOT%\lib\cmake\Qul\QulGenerators.cmake -DQUL_PLATFORM=example-baremetal nmake
To install a platform build, use the
CMAKE_INSTALL_PREFIX option, in addition to the CMake options for the developer build. In the following CMake command, set the
CMAKE_INSTALL_PREFIX to the path where you want to install the port:
cmake $QUL_ROOT -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=$QUL_TOOLCHAIN_FILE -DQUL_TARGET_TOOLCHAIN_DIR=/path/to/the/toolchain -DQUL_GENERATORS=$QUL_ROOT/lib/cmake/Qul/QulGenerators.cmake -DQUL_PLATFORM=example-baremetal -DCMAKE_INSTALL_PREFIX=~/dev/qul-example-platform nmake nmake install
cmake %QUL_ROOT% -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=%QUL_TOOLCHAIN_FILE% -DQUL_TARGET_TOOLCHAIN_DIR=c:\path\to\the\toolchain -DQUL_GENERATORS=%QUL_ROOT%\lib\cmake\Qul\QulGenerators.cmake -DQUL_PLATFORM=example-baremetal -DCMAKE_INSTALL_PREFIX=C:\dev\qul-example-platform nmake nmake install
Set up your Qt Creator development environment with the MCU plugin as described in the Qt Creator Manual > Connecting MCUs topic.
Note: Qt Creator does not support custom toolchains yet, so for Qt Creator support one of the toolchains shipped with Qt Quick Ultralite in
lib\cmake\Qul\toolchain must be used.
To build the platform port for Qt Creator integration, set these two environment variables:
CMAKE_INSTALL_PREFIXto Qt for MCUs install directory. It should match the Qt for MCUs version set in the Edit > Preferences > Devices > MCU option in Qt Creator.
QUL_VERSIONto the corresponding version number. For example, if Qt Creator is configured to use
<VERSION>is the directory containing the Qt Quick Ultralite version you are using (for example 2.5).
After setting these variables, use the following commands to configure and install the platform port:
export QUL_VERSION=<VERSION> cmake $QUL_ROOT -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=$QUL_TOOLCHAIN_FILE -DQUL_TARGET_TOOLCHAIN_DIR=/path/to/the/toolchain -DQUL_GENERATORS=$QUL_ROOT/lib/cmake/Qul/QulGenerators.cmake -DQUL_PLATFORM=example-baremetal -DCMAKE_INSTALL_PREFIX=$QUL_ROOT -DQUL_VERSION=$QUL_VERSION -DQUL_BUILD_DEMOS=off -DQUL_BUILD_EXAMPLES=off nmake nmake install
set QUL_VERSION=<VERSION> cmake %QUL_ROOT% -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=%QUL_TOOLCHAIN_FILE% -DQUL_TARGET_TOOLCHAIN_DIR=c:\path\to\the\toolchain -DQUL_GENERATORS=%QUL_ROOT%\lib\cmake\Qul\QulGenerators.cmake -DQUL_PLATFORM=example-baremetal -DCMAKE_INSTALL_PREFIX=%QUL_ROOT% -DQUL_VERSION=%QUL_VERSION% -DQUL_BUILD_DEMOS=off -DQUL_BUILD_EXAMPLES=off nmake nmake install
You can disable building of demos and examples, as they are not needed for the Qt Creator integration.
Add the following CMake options to the earlier command, if you are using Qt for MCUs evaluation version or don't want to rebuild the framework:
Once the installation is complete, create a kit for your platform port using the Edit > Preferences > Devices > MCU option in Qt Creator. If a kit is already configured for the target, remove it before creating the new one.
Finally, the kit for your platform is ready for use in Qt Creator. If you created an Mcu Support Application project, use the new kit to build and link the Qt Quick Ultralite application against your platform library.
Assuming that you have set up the flash targets as described in Getting started, run the application on the target hardware by pressing the Run button in Qt Creator.
Available under certain Qt licenses.
Find out more.