diff options
author | Cristian Adam <cristian.adam@qt.io> | 2022-06-15 13:09:14 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-06-16 22:39:26 +0000 |
commit | 393eb4fa97daeb417d159254a53cd926aab77415 (patch) | |
tree | 610cfc50451f0781db2f10c4b28335266a8d9213 /src/corelib | |
parent | b8ed8789dba8804fe58b55cd26bce0870dee1591 (diff) |
Doc: Document how to treat qt_add_big_resources args as source files
The arguments to qt_add_big_resources are not known to CMake as source
files.
They need to be added explicitly to a CMake target in order for Qt Creator
to treat them as source files and in the case of a qrc file to expand
the contents in the project view.
Fixes: QTBUG-104320
Change-Id: Iea755d998e8f9814a82983272731b0c654f80644
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 7037f4620fb59b669d32fbce0ef79aabe38a716a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/doc/snippets/cmake-macros/examples.cmake | 5 | ||||
-rw-r--r-- | src/corelib/doc/src/cmake/qt_add_big_resources.qdoc | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/doc/snippets/cmake-macros/examples.cmake b/src/corelib/doc/snippets/cmake-macros/examples.cmake index 31cf4811e0..62d6324bc9 100644 --- a/src/corelib/doc/snippets/cmake-macros/examples.cmake +++ b/src/corelib/doc/snippets/cmake-macros/examples.cmake @@ -20,6 +20,11 @@ qt_add_resources(myapp "images" #! [qt_add_big_resources] 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) + add_executable(myapp ${SOURCES}) #! [qt_add_big_resources] diff --git a/src/corelib/doc/src/cmake/qt_add_big_resources.qdoc b/src/corelib/doc/src/cmake/qt_add_big_resources.qdoc index 07e75f6fc5..8cb78cf9c1 100644 --- a/src/corelib/doc/src/cmake/qt_add_big_resources.qdoc +++ b/src/corelib/doc/src/cmake/qt_add_big_resources.qdoc @@ -34,6 +34,10 @@ generates object files (\c .o, \c .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. +\note The \c{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 +\c{SKIP_AUTORCC} set to \c{ON}. + \section1 Arguments You can set additional \c{OPTIONS} that should be added to the \c{rcc} calls. |