Compiles big binary resources into object code.
The command is defined in the
核心
组件对于
Qt6
package, which can be loaded like so:
find_package(Qt6 REQUIRED COMPONENTS Core)
This command was introduced in Qt 5.12.
qt_add_big_resources(<VAR> file1.qrc [file2.qrc ...]
[OPTIONS ...])
若
versionless commands
are disabled, use
qt6_add_big_resources()
instead. It supports the same set of arguments as this command.
创建编译对象文件从 Qt 资源文件使用
RCC (资源编译器)
。将生成文件的路径添加到
<VAR>
.
这类似于
qt_add_resources
,但直接生成对象文件 (
.o
,
.obj
文件) 而不是 C++ 源代码。这允许嵌入更大资源,若编译到 C++ 源代码然后再编译成二进制,会太耗时 (或内存密集)。
注意:
The
file1.qrc
will not be treated as a source file by Qt Creator. It needs to be added as a source file to a CMake target and have the property
SKIP_AUTORCC
设为
ON
.
警告: This command is not supported when building for iOS, use qt_add_resources instead. See QTBUG-103497 了解细节。
可以设置额外
选项
应该被添加到
rcc
调用。可以查找可能的选项在
RCC (资源编译器) 文档编制
.
set(SOURCES main.cpp)
qt_add_big_resources(SOURCES big_resource.qrc)
# Have big_resource.qrc treated as a source file by Qt Creator
list(APPEND SOURCES big_resource.qrc)
set_property(SOURCE big_resource.qrc PROPERTY SKIP_AUTORCC ON)
qt_add_executable(myapp ${SOURCES})