qt_add_binary_resources

從 Qt 資源文件列錶創建 RCC (資源編譯器) 文件。

命令的定義在 Core 組件對於 Qt6 包,可以像這樣加載:

find_package(Qt6 REQUIRED COMPONENTS Core)
					

This command was introduced in Qt 5.10.

概要

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

無版本命令 被禁用,使用 qt6_add_binary_resources() 代替。它支持如此命令的一組相同自變量。

描述

添加自定義 target that compiles Qt resource files into a binary .rcc 文件。

自變量

DESTINATION sets the path of the generated .rcc file. The default is ${CMAKE_CURRENT_BINARY_DIR}/${target}.rcc .

可以設置額外 OPTIONS 應該被添加到 rcc 調用。可以查找可能的選項在 RCC (資源編譯器) 文檔編製 .

範例

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