このページでは

qt_add_binary_resources

QtリソースファイルのリストからRCCファイルを作成します。

このコマンドは、Qt6 パッケージのCore コンポーネントに定義されており、次のように読み込むことができます:

find_package(Qt6 REQUIRED COMPONENTS Core)

このコマンドは Qt 5.10 で導入されました。

概要

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

バージョン指定なしのコマンドが無効になっている場合は、代わりに `qt6_add_binary_resources() ` を使用してください。このコマンドと同じ引数セットをサポートしています。

説明

Qtリソースファイルをバイナリ形式の.rcc ファイルにコンパイルする、カスタムtarget を追加します。

引数

DESTINATION 生成される.rcc ファイルのパスを設定します。デフォルトは${CMAKE_CURRENT_BINARY_DIR}/${target}.rcc です。

rcc への呼び出しに追加すべきOPTIONS をさらに指定できます。利用可能なオプションについては、rccのドキュメントを参照してください。

例

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.