qt_add_binary_resources
Crea un file RCC a partire da un elenco di file di risorse Qt.
Il comando è definito nel componente ` Core ` del pacchetto ` Qt6 `, che può essere caricato in questo modo:
find_package(Qt6 REQUIRED COMPONENTS Core)Questo comando è stato introdotto in Qt 5.10.
Sintassi
qt_add_binary_resources(target file1.qrc [file2.qrc ...]
[DESTINATION ...]
[OPTIONS ...])Se i comandi senza versione sono disabilitati, utilizzare invece qt6_add_binary_resources(). Supporta lo stesso insieme di argomenti di questo comando.
Descrizione
Aggiunge un ` target ` personalizzato che compila i file di risorse Qt in un file binario ` .rcc `.
Argomenti
DESTINATION imposta il percorso del file di .rcc generato. Il valore predefinito è ${CMAKE_CURRENT_BINARY_DIR}/${target}.rcc.
È possibile specificare ulteriori OPTIONS da aggiungere alle chiamate a rcc. Le opzioni disponibili sono riportate nella documentazione di rcc.
Esempi
qt_add_binary_resources(resources project.qrc OPTIONS -no-compress)
add_dependencies(myapp resources)© 2026 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.