qt_add_binary_resources

Erzeugt eine RCC-Datei aus einer Liste von Qt-Ressourcen-Dateien.

Der Befehl ist in der Core Komponente des Qt6 Pakets definiert, die so geladen werden kann:

find_package(Qt6 REQUIRED COMPONENTS Core)

Dieser Befehl wurde in Qt 5.10 eingeführt.

Synopse

qt_add_binary_resources(target file1.qrc [file2.qrc ...]
                        [DESTINATION ...]
                        [OPTIONS ...])

Wenn versionslose Befehle deaktiviert sind, verwenden Sie stattdessen qt6_add_binary_resources(). Es unterstützt den gleichen Satz an Argumenten wie dieser Befehl.

Beschreibung

Fügt ein benutzerdefiniertes target hinzu, das Qt-Ressourcendateien in eine binäre .rcc Datei kompiliert.

Argumente

DESTINATION legt den Pfad der erzeugten .rcc Datei fest. Die Vorgabe ist ${CMAKE_CURRENT_BINARY_DIR}/${target}.rcc.

Sie können zusätzliche OPTIONS setzen, die zu den rcc Aufrufen hinzugefügt werden sollen. Mögliche Optionen finden Sie in der rcc-Dokumentation.

Beispiele

qt_add_binary_resources(resources project.qrc OPTIONS -no-compress)
add_dependencies(myapp resources)

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