qt_am_add_systemui_wrapper

Note: This command is in technology preview and may change in future releases.

Synopsis

qt_am_add_systemui_wrapper(
    target
    [EXECUTABLE appman-executable]
    [MAIN_QML_FILE main.qml]
    [CONFIG_YAML config.yaml ...]
    [EXTRA_ARGS ...]
    [EXTRA_FILES ...]
    [EXTRA_FILES_GLOB ...]
    [INSTALL_DIR install-dir]
)

If versionless commands are disabled, use qt6_am_add_systemui_wrapper() instead. It supports the same set of arguments as this command.

Description

Generates a .bat (Windows) or .sh (macOS, Linux) wrapper in the build directory to easily run your QML based System UI referenced by target on the desktop or within Qt Creator. It will also automatically copy the required files from the source to the build directory: these are the MAIN_QML_FILE, any CONFIG_YAML files as well as all EXTRA_FILES.

Any directory in EXTRA_FILES will be recursively copied. By default the file types are limited to *.qml *.js qmldir *.json *.yaml *.png *.jpg *.svg, but you can supply a custom glob pattern via EXTRA_FILES_GLOB (see CMake's file(GLOB) command for details).

If you also want this command to automatically generate installation rules for all files, you can specify the destination directory via INSTALL_DIR. By default, no installation rule is created.

If you want to use a custom build of the application manager, you can do that by using EXECUTABLE. Otherwise, the appman binary of the current Qt build will be used.

All EXTRA_ARGS will be appended to the command line when running the EXECUTABLE from the wrapper script.

For very simple setups, specifying just the MAIN_QML_FILE is enough. If you already have an am-config.yaml, you can reference that via CONFIG_YAML. In case your main.qml is already set in the YAML config file, you do not need to specify it here again.

Warning: Please note that this command will not scale when your project is becoming more sophisticated over time. It is only meant to help you get started without diving too deep into CMake.

Examples

Here is a snippet from the applicationmanager/minidesk example, showing how this function is used there:

qt6_am_add_systemui_wrapper(minidesk
    INSTALL_DIR "${INSTALL_EXAMPLEDIR}"
    CONFIG_YAML am-config.yaml
    EXTRA_FILES apps system-ui
    EXTRA_ARGS --verbose
)

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.