En esta página

qt_add_binary_resources

Crea un archivo RCC a partir de una lista de archivos de recursos Qt.

El comando está definido en el componente Core del paquete Qt6, que puede cargarse de este modo:

find_package(Qt6 REQUIRED COMPONENTS Core)

Este comando se introdujo en Qt 5.10.

Sinopsis

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

Si los comandos versionless están deshabilitados, utilice qt6_add_binary_resources() en su lugar. Admite el mismo conjunto de argumentos que este comando.

Descripción

Añade un target personalizado que compila archivos de recursos Qt en un archivo binario .rcc.

Argumentos

DESTINATION establece la ruta del archivo .rcc generado. El valor predeterminado es ${CMAKE_CURRENT_BINARY_DIR}/${target}.rcc.

Puede establecer OPTIONS adicionales que deben añadirse a las llamadas a rcc. Puede encontrar las posibles opciones en la documentación de rcc.

Ejemplos

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.