C
Project setup
This guide uses an example platform, example-baremetal
to explain the porting steps. You can create your platform port based on this example platform or create one from scratch.
Setting up a Qt Quick Ultralite platform port project
Qt Quick Ultralite has all its supported platforms under the platform\boards
directory, where they are categorized based on the platform manufacturer's name. For example, the example-baremetal
platform port's manufacturer is qt and the port can be found from platform\boards\qt\example-baremetal
.
The variable BOARD_MANUFACTURER_NAME will be automatically set in CMake and it contains the name of the manufacturer folder the board was found in.
To make your platform visible to Qt Quick Ultralite's CMake scripts, create a new directory for the platform:
mkdir -p platform/boards/<MANUFACTURER_NAME>/<YOUR_PLATFORM>
md platform\boards\<MANUFACTURER_NAME>\<YOUR_PLATFORM>
Where <MANUFACTURER_NAME> and <YOUR_PLATFORM> should be lower case names to avoid issues.
Note: While the names of the officially supported platforms have baremetal
, freertos
or other suffixes, it's not a strict requirement to have such an OS suffix in the platform name.
Project structure
Qt Quick Ultralite requires having a specific project structure, that you will create by following this guide.
- 📁 <MANUFACTURER_NAME>
- 🗎 CMakeLists.txt
- 📁 <YOUR_PLATFORM>
- 🗎 CMakeLists.txt
- 📁 cmake
- 📁 <YOUR_COMPILER>
- 🗎 <YOUR_LINKER_SCRIPT>
- 🗎 BoardArchitectureConfig.cmake
- 🗎 BoardDefaults.qmlprojectconfig
- 🗎 BSPConfig.cmake
- 🗎 LinkerScriptConfig.cmake
- 🗎 ExecutableHook.cmake (optional)
- 📁 <YOUR_COMPILER>
As shown above, there are several configuration files defining default variables for a platform:
BoardDefaults.qmlprojectconfig
contains Qt Quick Ultralite engine-specific configurations for the target board.BoardArchitectureConfig.cmake
contains information about the platform architecture.LinkerScriptConfig.cmake
contains linker script configurations, which will be described in a later chapter.- Platform-specific build system configurations are in
CMakeLists.txt
Manufacturer CMakeLists.txt
Add a CMakeLists.txt
file under the <MANUFACTURER_NAME> folder with at least the following contents:
include(CMakeDependentOption) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/${QUL_PLATFORM})
cmake
directory
Your project must have a platform\<BOARD_MANUFACTURER_NAME>\<YOUR_PLATFORM>\cmake
directory containing compiler and board information for Qt Quick Ultralite to be able to recognize and compile the platform. You may use the platform\boards\qt\example-baremetal\cmake
directory as the basis for your platform's cmake directory.
The required files in the cmake
directory are shown in the directory structure above.
Note that example-baremetal
project's cmake
directory contains configuration for ARM GCC compiler and IAR compiler. If you are using a compiler other than ARM GCC, Green Hills for V850 or ARM, or IAR for ARM compilers, additional configuration is needed. For more information, see Using a custom toolchain.
CPU Architecture Configuration
Qt Quick Ultralite comes with a set of available CPU architectures that are supported. The list can be found in platform/architecture/
and it contains the most common Cortex-M architectures.
To use one of the default architectures, create <MANUFACTURER_NAME>/<YOUR_PLATFORM>/BoardArchitectureConfig.cmake
as follows:
set (QUL_PLATFORM_ARCHITECTURE "cortex-m7-hf-fpv5-d16")
Otherwise, in case you need a custom architecture, see Using Custom Architectures how to create your own in the <YOUR_COMPILER>
folder.
set(QUL_PLATFORM_ARCHITECTURE SomeCustomName) set(QUL_PLATFORM_ARCHITECTURE_FILE "${CMAKE_CURRENT_LIST_DIR}/${QUL_COMPILER_NAME}/architecture.cmake")
Available under certain Qt licenses.
Find out more.