qt_am_create_builtin_package

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

Synopsis

qt_am_create_builtin_package(
    target
    FILES ...
    [OUTPUT_DIRECTORY output_dir]
    [INSTALL_DIRECTORY install_dir]
    [DEPENDENCIES ...]
)

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

Description

Adds a custom target that acts as a built-in package for the application-manager. The supplied FILES need to contain at least an info.yaml file that describes the package.

If OUTPUT_DIRECTORY is specified, all files specified in FILES will be copied to this folder.

Using the DEPENDENCIES argument, you can specify a list of targets this package depends on.

The INSTALL_DIRECTORY argument can be used to specify a directory where all files specified in FILES and all dependencies will be installed into.

See also qt_am_create_installable_package for packages which can be installed and uninstalled.

Note: This function will serve as an anchor for the application manager's QtCreator integration to discover the available packages in a System UI.

Examples

Here is a snippet from the applicationmanager/hello-world example, showing how this function is used to create a simple package:

qt_am_create_builtin_package(hello-world.blue
    OUTPUT_DIRECTORY apps/hello-world.blue
    INSTALL_DIRECTORY ${INSTALL_EXAMPLEDIR}/apps/hello-world.blue
    FILES
        apps/hello-world.blue/info.yaml
        apps/hello-world.blue/icon.png
        apps/hello-world.blue/main.qml
)

A builtin package using a compiled QML module looks like this:

qt_add_qml_module(
    Twins_module
    URI "Twins"
    NO_PLUGIN
    QML_FILES twins.qml
)

qt_am_create_builtin_package(Twins
    INSTALL_DIRECTORY "${INSTALL_EXAMPLEDIR}/apps/Twins"
    FILES
        info.yaml
        icon.png
    DEPENDENCIES
        Twins_module
)

© 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.