qt_am_create_installable_package

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

Synopsis

qt_am_create_installable_package(
    target
    FILES ...
    [OUTPUT_DIRECTORY output_dir]
    [INSTALL_DIRECTORY install_dir]
    [PACKAGE_DIRECTORY package_dir]
    [PACKAGE_NAME package_name]
    [DEPENDENCIES ...]
)

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

Description

Adds a custom target that, when executed, uses the appman-packager tool to create a package for the application found in PACKAGE_DIRECTORY. The result is written to OUTPUT_DIRECTORY, which defaults to ${CMAKE_CURRENT_BINARY_DIR}. The PACKAGE_NAME is used as the name of the package and defaults to ${target}.ampkg.

The FILES argument is a list of files that will be copied to the package directory and needs to at least contain an info.yaml file that describes the package.

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 the package will be installed into.

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/package-installation example, showing how this function is used to create a simple installable package:

qt6_am_create_installable_package(installable-red
    OUTPUT_DIRECTORY ps-data/upload
    INSTALL_DIRECTORY ${INSTALL_EXAMPLEDIR}/ps-data/upload
    FILES
        installable-apps/installable.red/info.yaml
        installable-apps/installable.red/icon.png
        installable-apps/installable.red/main.qml
)

An installable package using a compiled QML module looks like this:

qt_add_qml_module(installable-pink-module
    URI "Pink"
    NO_PLUGIN
    OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Pink"
    QML_FILES installable-apps/installable.pink/main.qml
)
set_target_properties(installable-pink-module PROPERTIES
    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/installable-pink_package
)

qt6_am_create_installable_package(installable-pink
    OUTPUT_DIRECTORY ps-data/upload
    INSTALL_DIRECTORY ${INSTALL_EXAMPLEDIR}/ps-data/upload
    FILES
        installable-apps/installable.pink/info.yaml
        installable-apps/installable.pink/icon.png
    DEPENDENCIES
        installable-pink-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.