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.

描述

創建編譯對象文件從 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})