Skip to content

Commit

Permalink
Doc: Fix issues in CMake command docs
Browse files Browse the repository at this point in the history
- qt_finalize_target missed a reference to qt_add_plugin()
- qt_generate_deploy_app_script is also supported on Linux
- Use simplers examples for QT_DEPLOY_SUPPORT and
  qt_standard_project_setup()

Task-number: QTBUG-113116
Pick-to: 6.5
Change-Id: If6bfd01b9615a73ab1bafddee350e49f6902a6c0
Reviewed-by: Joerg Bornemann <[email protected]>
  • Loading branch information
leena-miettinen committed Apr 25, 2023
1 parent e86fcae commit ab41256
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/corelib/doc/src/cmake/cmake-configure-variables.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ part of a post-build rule.
The following example shows one way the variable would be used when installing
an application, along with its runtime dependencies:

\include cmake-deploy-runtime-dependencies.qdocinc
\include cmake-deploy-modified-variable-values.qdocinc

\sa {qt6_deploy_runtime_dependencies}{qt_deploy_runtime_dependencies()},
{qt6_deploy_qml_imports}{qt_deploy_qml_imports()}
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/doc/src/cmake/qt_deploy_translations.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ that is used in the project via \c{find_package}.
The \c LCONVERT argument specifies the \c lconvert executable that is used to
combine the catalogs. By default, the Qt installation's \c lconvert is used.

For debugging purposed, the \c VERBOSE argument can be set to turn on diagnostic
For debugging purposes, the \c VERBOSE argument can be set to turn on diagnostic
messages.

\sa QT_DEPLOY_TRANSLATIONS_DIR
Expand Down
8 changes: 4 additions & 4 deletions src/corelib/doc/src/cmake/qt_finalize_target.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ was created, so this command should also be called from that same directory
scope.

This command is ordinarily invoked as part of a call to
\l{qt6_add_executable}{qt_add_executable()} or
\l{qt6_add_library}{qt_add_library()}. The timing of when that call takes
place and when it might need to be called explicitly by a project is discussed
in the documentation of those commands.
\l{qt6_add_executable}{qt_add_executable()},
\l{qt6_add_library}{qt_add_library()}, or \l{qt6_add_plugin}{qt_add_plugin()}.
The timing of when that call takes place and when a project might need to call
it explicitly, is discussed in the documentation of those commands.

\sa {qt6_set_finalizer_mode}{qt_set_finalizer_mode()}

Expand Down
24 changes: 2 additions & 22 deletions src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
\include cmake-find-package-core.qdocinc

\cmakecommandsince 6.3
\note This command is currently only supported on Windows and macOS.
\note This command is currently only supported on Windows, macOS, and Linux.

\section1 Synopsis

Expand Down Expand Up @@ -93,25 +93,5 @@ unmodified to \l{qt6_deploy_runtime_dependencies}{qt_deploy_runtime_dependencies

\section1 Example

\badcode
cmake_minimum_required(VERSION 3.16...3.22)
project(MyThings)

find_package(Qt6 REQUIRED COMPONENTS Core)
qt_standard_project_setup()

qt_add_executable(MyApp main.cpp)

install(TARGETS MyApp
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

qt_generate_deploy_app_script(
TARGET MyApp
OUTPUT_SCRIPT deploy_script
NO_UNSUPPORTED_PLATFORM_ERROR
)
install(SCRIPT ${deploy_script})
\endcode
\include cmake-generate-deploy-app-script.qdocinc
*/
2 changes: 1 addition & 1 deletion src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ setting the \l{QT_NO_STANDARD_PROJECT_SETUP} variable to true.

\section1 Example

\include cmake-deploy-runtime-dependencies.qdocinc
\include cmake-generate-deploy-app-script.qdocinc
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
\badcode
cmake_minimum_required(VERSION 3.16...3.22)
project(MyThings)

find_package(Qt6 REQUIRED COMPONENTS Core)
qt_standard_project_setup()

qt_add_executable(MyApp main.cpp)

install(TARGETS MyApp
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

qt_generate_deploy_app_script(
TARGET MyApp
OUTPUT_SCRIPT deploy_script
NO_UNSUPPORTED_PLATFORM_ERROR
)
install(SCRIPT ${deploy_script})
\endcode

0 comments on commit ab41256

Please sign in to comment.