qt_add_big_resources

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.

描述

Creates compiled object files from Qt resource files using the RCC (资源编译器) . Paths to the generated files are added to <VAR> .

This is similar to qt_add_resources , but directly generates object files ( .o , .obj ) files instead of C++ source code. This allows to embed bigger resources, where compiling to C++ sources and then to binaries would be too time consuming or memory intensive.

注意: 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 了解细节。

自变量

可以设置额外 OPTIONS that should be added to the rcc calls. You can find possible options in the 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})
					

内容