Doc: Add CMake section about how to include .qrc files in a project

The current docs only describes how to do this in qmake. Let's use a tab
and add a CMake section.

Fixes: QTBUG-120568
Pick-to: 6.7 6.6 6.5
Change-Id: I766e92818c3e20aad5498443aa107aa369089ad0
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This commit is contained in:
Andreas Eliasson 2024-01-09 10:45:26 +01:00
parent 9848c8014a
commit 37c2d3cda3
1 changed files with 31 additions and 4 deletions

View File

@ -164,12 +164,39 @@
is possible to provide a different configuration file for different platforms and
locales. See \l QFileSelector documentation for more details.
Finally, the \c .qrc file must be listed in the application's \c .pro file so that
the build system knows about it. For example:
Finally, the \c .qrc file must be listed in the application's build file.
For example:
\code
RESOURCES = application.qrc
\if defined(onlinedocs)
\tab {build-qt-app}{tab-cmake}{CMakeLists.txt (CMake)}{checked}
\tab {build-qt-app}{tab-qmake}{.pro (qmake)}{}
\tabcontent {tab-cmake}
\else
\section2 Using CMake
\endif
\badcode
set(CMAKE_AUTORCC ON)
qt_add_executable(my_app
application.qrc
main.cpp
...
)
\endcode
\if defined(onlinedocs)
\endtabcontent
\tabcontent {tab-qmake}
\else
\section2 Using qmake
\endif
\badcode
RESOURCES = application.qrc
...
\endcode
\if defined(onlinedocs)
\endtabcontent
\endif
See also: \l {Build System Integration}
\section1 Related Information