Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qt_generate_deploy_app_script.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2021 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
/*!
5
\page qt-generate-deploy-app-script.html
6
\ingroup cmake-commands-qtcore
7
8
\title qt_generate_deploy_app_script
9
\keyword qt6_generate_deploy_app_script
10
11
\summary {Generate a deployment script for an application.}
12
13
\include cmake-find-package-core.qdocinc
14
15
\cmakecommandsince 6.3
16
\note This command is currently only supported on Windows, macOS, and Linux.
17
18
\section1 Synopsis
19
20
\badcode
21
qt_generate_deploy_app_script(
22
TARGET target
23
OUTPUT_SCRIPT <var>
24
[NO_TRANSLATIONS]
25
[NO_COMPILER_RUNTIME]
26
[NO_UNSUPPORTED_PLATFORM_ERROR]
27
[NO_PLUGINS] # since Qt 6.10
28
[EXCLUDE_PLUGIN_TYPES type_or_target...] # since Qt 6.10
29
[INCLUDE_PLUGIN_TYPES type_or_target...] # since Qt 6.10
30
[EXCLUDE_PLUGINS name...] # since Qt 6.10
31
[INCLUDE_PLUGINS name...] # since Qt 6.10
32
[DEPLOY_TOOL_OPTIONS ...]
33
[PRE_INCLUDE_REGEXES regexes...]
34
[PRE_EXCLUDE_REGEXES regexes...]
35
[POST_INCLUDE_REGEXES regexes...]
36
[POST_EXCLUDE_REGEXES regexes...]
37
[POST_INCLUDE_FILES files...]
38
[POST_EXCLUDE_FILES files...]
39
)
40
\endcode
41
42
\versionlessCMakeCommandsNote qt6_generate_deploy_app_script()
43
44
\section1 Description
45
46
Installing an executable target with \l{install(TARGETS)} only installs the
47
target's executable (except for macOS app bundles, which will copy the whole
48
bundle). You need to explicitly install any other libraries or plugins the
49
executable depends on yourself. \c{qt_generate_deploy_app_script()} is a
50
convenience command intended to simplify that process. It expects the
51
application to follow Qt's recommended install directory structure fairly
52
closely. That structure is based on CMake's default install layout, as
53
determined by \l{GNUInstallDirs} (except for macOS app bundles, which follow
54
Apple's requirements instead).
55
56
The command generates a script whose name will be stored in the variable named
57
by the \c{OUTPUT_SCRIPT} option. That script is only written at CMake
58
generation time. It is intended to be used with the \l{install(SCRIPT)} command,
59
which should come after the application's target has been installed using
60
\l{install(TARGETS)}.
61
62
The deployment script will call \l{qt6_deploy_runtime_dependencies}
63
{qt_deploy_runtime_dependencies()} with a suitable set of options for the standard
64
install layout. Currently, this is only implemented for
65
\list
66
\li macOS app bundles built on a macOS host,
67
\li Linux executables built on a Linux host,
68
\li and Windows executables built on a Windows host.
69
\endlist
70
Cross-building a Windows executable on a Linux host, as well as similar
71
scenarios, are not currently supported.
72
Calling \c{qt_generate_deploy_app_script()} in such a case will result
73
in a fatal error, unless the \c{NO_UNSUPPORTED_PLATFORM_ERROR} option is given.
74
75
On platforms other than macOS, Qt translations are automatically deployed. To
76
inhibit this behavior, specify \c{NO_TRANSLATIONS}. Use
77
\l{qt6_deploy_translations}{qt_deploy_translations()} to deploy translations in a
78
customized way.
79
80
For Windows desktop applications, the required runtime files for the compiler
81
are also installed by default. To prevent this, specify \c{NO_COMPILER_RUNTIME}.
82
83
Since Qt 6.7, you can use \c{DEPLOY_TOOL_OPTIONS} to pass additional options to
84
the underlying deployment tool. This only has an effect if the underlying
85
deployment tool is either macdeployqt or windeployqt.
86
87
For deploying a QML application, use
88
\l{qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()}
89
instead.
90
91
For generating a custom deployment script, use
92
\l{qt6_generate_deploy_script}{qt_generate_deploy_script}.
93
94
The options \c{PRE_INCLUDE_REGEXES}, \c{PRE_EXCLUDE_REGEXES},
95
\c{POST_INCLUDE_REGEXES}, \c{POST_EXCLUDE_REGEXES}, \c{POST_INCLUDE_FILES}, and
96
\c{POST_EXCLUDE_FILES} can be specified to control the deployment of runtime
97
dependencies. These options do not apply to all platforms and are forwarded
98
unmodified to \l{qt6_deploy_runtime_dependencies}{qt_deploy_runtime_dependencies()}.
99
100
The options \c EXCLUDE_PLUGINS, \c EXCLUDE_PLUGIN_TYPES, \c INCLUDE_PLUGINS, and
101
\c INCLUDE_PLUGIN_TYPES are used to select Qt plugins. See
102
\l{qt6_deploy_runtime_dependencies}{qt_deploy_runtime_dependencies()} for their
103
documentation.
104
105
You can turn off plugin deployment altogether with the \c NO_PLUGINS option.
106
107
\sa {qt6_standard_project_setup}{qt_standard_project_setup()},
108
{qt6_generate_deploy_script}{qt_generate_deploy_script()},
109
{qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()}
110
111
\section1 Example
112
113
The following example shows how to deploy an application \c{MyApp}.
114
115
\include cmake-generate-deploy-app-script.qdocinc
116
117
The following example shows how to use the \c{DEPLOY_TOOL_OPTIONS} parameter to
118
pass different options to macdeployqt and windeployqt.
119
120
\include cmake-generate-deploy-app-script-deploy-tool-options.qdocinc
121
122
*/
qtbase
src
corelib
doc
src
cmake
qt_generate_deploy_app_script.qdoc
Generated on
for Qt by
1.14.0