From 7ffe548334035e5a8ac25dcef7bca5c33a43c09f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 30 Jan 2024 17:29:13 +0100 Subject: [PATCH] Doc: Address qt_deploy_runtime_dependencies issues from API review Task-number: QTBUG-121708 Change-Id: I8b7b3a7d03ab757f3cb6e55f27f0e4ba0e4a5bbd Reviewed-by: Alexandru Croitor (cherry picked from commit 1902f98a9d02d576d38059081a395d9cf6a342af) Reviewed-by: Qt Cherry-pick Bot --- .../cmake/qt_deploy_runtime_dependencies.qdoc | 13 ++++++++++-- ...e-dependencies-deploy-tool-options.qdocinc | 20 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 src/corelib/doc/src/includes/cmake-deploy-runtime-dependencies-deploy-tool-options.qdocinc diff --git a/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc b/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc index 2ff7675ffa9..ead38f4a59d 100644 --- a/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc +++ b/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc @@ -134,8 +134,9 @@ in a customized way. For Windows desktop applications, the required runtime files for the compiler are also installed by default. To prevent this, specify \c{NO_COMPILER_RUNTIME}. -You can use \c{DEPLOY_TOOL_OPTIONS} to pass additional options to the underlying -deployment tool. +Since Qt 6.7, you can use \c{DEPLOY_TOOL_OPTIONS} to pass additional options to +the underlying deployment tool. This only has an effect if the underlying +deployment tool is either macdeployqt or windeployqt. On Linux, deploying runtime dependencies is based on CMake's \c{file(GET_RUNTIME_DEPENDENCIES)} command. The options \c{PRE_INCLUDE_REGEXES}, @@ -157,5 +158,13 @@ The default value of \c{POST_EXCLUDE_REGEXES} is constructed from the value of \section1 Example +The following example shows how to deploy an application \c{MyApp}. + \include cmake-deploy-runtime-dependencies.qdocinc + +The following example shows how to use the \c{DEPLOY_TOOL_OPTIONS} parameter to +pass different options to macdeployqt and windeployqt. + +\include cmake-deploy-runtime-dependencies-deploy-tool-options.qdocinc + */ diff --git a/src/corelib/doc/src/includes/cmake-deploy-runtime-dependencies-deploy-tool-options.qdocinc b/src/corelib/doc/src/includes/cmake-deploy-runtime-dependencies-deploy-tool-options.qdocinc new file mode 100644 index 00000000000..0f46379c45e --- /dev/null +++ b/src/corelib/doc/src/includes/cmake-deploy-runtime-dependencies-deploy-tool-options.qdocinc @@ -0,0 +1,20 @@ +\badcode +set(deploy_tool_options_arg "") +if(APPLE) + set(deploy_tool_options_arg --hardened-runtime) +elseif(WIN32) + set(deploy_tool_options_arg --no-compiler-runtime) +endif() + +# Generate a deployment script to be executed at install time +qt_generate_deploy_script( + TARGET MyApp + OUTPUT_SCRIPT deploy_script + CONTENT " +qt_deploy_runtime_dependencies( + EXECUTABLE \"${executable_path}\" + DEPLOY_TOOL_OPTIONS "${deploy_tool_options_arg}" + GENERATE_QT_CONF + VERBOSE +)") +\endcode