Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
cmake-deploy-variables.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/* NOTE: The variables documented here are available when running a deploy
5** script, they are not available at configure time (i.e. when running
6** CMake). Both these and the set of configure-time variables are all
7** members of the cmake-variables-qtcore group.
8**/
9
10/*!
11\page cmake-variable-qt-deploy-prefix.html
12\ingroup cmake-variables-qtcore
13
14\title QT_DEPLOY_PREFIX
15\target cmake-variable-QT_DEPLOY_PREFIX
16
17\summary {Base location for a deployment.}
18
19\include cmake-deploy-var-usage.qdocinc
20
21\cmakevariablesince 6.3
22
23\c{QT_DEPLOY_PREFIX} provides the base deployment directory. The other
24\c{QT_DEPLOY_..._DIR} variables should be treated as relative to this location.
25The value of \c{QT_DEPLOY_PREFIX} may be relative or absolute, so projects
26should not assume one or the other in any given situation. A relative path is
27expected to be treated as relative to the current working directory, as seen
28by the build tool (ninja, make, and so on) at install time.
29
30The default value is \c{$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}}, which is the
31base location CMake uses during installation. If that evaluates to an empty
32string, the default value will be a dot (.) instead, which is generally the
33appropriate value when deploying as part of a post-build rule. This two-step
34fallback logic ensures that projects can assume \c{QT_DEPLOY_PREFIX} will not
35be an empty string, so it can safely be used as part of a path like
36\c{${QT_DEPLOY_PREFIX}/${QT_DEPLOY_BIN_DIR}}.
37
38To change the value of \c QT_DEPLOY_PREFIX, the project can be configured
39with a custom \l CMAKE_INSTALL_PREFIX as described in
40\l {Command Line cmake invocation}.
41
42The \l DESTDIR environment variable can also be used to modify the final
43installation, and thus deployment, location.
44
45Projects should rarely need to use this variable. In typical scenarios, deploy
46scripts should assume that the working directory is already set to the base
47install location and just use the prefix-relative \c{QT_DEPLOY_..._DIR}
48variables.
49
50\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_BIN_DIR, QT_DEPLOY_LIB_DIR,
51 QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR, QT_DEPLOY_TRANSLATIONS_DIR
52*/
53
54/*!
55\page cmake-variable-qt-deploy-bin-dir.html
56\ingroup cmake-variables-qtcore
57
58\title QT_DEPLOY_BIN_DIR
59\target cmake-variable-QT_DEPLOY_BIN_DIR
60
61\summary {Prefix-relative subdirectory for deploying runtime binaries on some target platforms.}
62
63\include cmake-deploy-var-usage.qdocinc
64
65\cmakevariablesince 6.3
66
67Projects should use \c QT_DEPLOY_BIN_DIR in their deploy scripts to avoid
68hard-coding a particular directory in which to deploy the following types of
69binaries:
70
71\list
72\li Executables on all platforms.
73\li DLLs on Windows.
74\endlist
75
76\c QT_DEPLOY_BIN_DIR defaults to the value of \c${CMAKE_INSTALL_BINDIR}
77(usually \c{bin}), which is provided by CMake's \l{GNUInstallDirs} module.
78To change the value of \c QT_DEPLOY_BIN_DIR, ensure that the project sets
79\c{CMAKE_INSTALL_BINDIR} before the \c Core package is found.
80
81The \c QT_DEPLOY_BIN_DIR path is relative to \l{QT_DEPLOY_PREFIX}.
82
83This variable is not meaningful when deploying into a macOS app bundle and
84should not be used for that scenario.
85
86\section1 Example
87
88\include cmake-deploy-runtime-dependencies.qdocinc
89
90\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_LIB_DIR,
91 QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR, QT_DEPLOY_TRANSLATIONS_DIR
92*/
93
94/*!
95\page cmake-variable-qt-deploy-lib-dir.html
96\ingroup cmake-variables-qtcore
97
98\title QT_DEPLOY_LIB_DIR
99\target cmake-variable-QT_DEPLOY_LIB_DIR
100
101\summary {Prefix-relative subdirectory for deploying libraries on some target platforms.}
102
103\include cmake-deploy-var-usage.qdocinc
104
105\cmakevariablesince 6.3
106
107Projects should use \c QT_DEPLOY_LIB_DIR in their deploy scripts to avoid
108hard-coding a particular directory in which to deploy the following types of
109binaries:
110
111\list
112\li Shared libraries on platforms other than Windows.
113\li Import libraries on Windows.
114\endlist
115
116\c QT_DEPLOY_LIB_DIR defaults to the value of \c${CMAKE_INSTALL_LIBDIR}
117(usually \c{lib} or \c{lib64}), which is provided by
118CMake's \l{GNUInstallDirs} module.
119To change the value of \c QT_DEPLOY_LIB_DIR, ensure that the project sets
120\c{CMAKE_INSTALL_LIBDIR} before the \c Core package is found.
121
122The \c QT_DEPLOY_LIB_DIR path is relative to \l{QT_DEPLOY_PREFIX}.
123
124This variable is not meaningful when deploying into a macOS app bundle and
125should not be used for that scenario.
126
127\section1 Example
128
129\include cmake-deploy-modified-variable-values.qdocinc
130
131\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR,
132 QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR, QT_DEPLOY_TRANSLATIONS_DIR
133*/
134
135/*!
136\page cmake-variable-qt-deploy-plugins-dir.html
137\ingroup cmake-variables-qtcore
138
139\title QT_DEPLOY_PLUGINS_DIR
140\target cmake-variable-QT_DEPLOY_PLUGINS_DIR
141
142\summary {Prefix-relative subdirectory for deploying Qt plugins on some target platforms.}
143
144\include cmake-deploy-var-usage.qdocinc
145
146\cmakevariablesince 6.3
147
148Projects should use \c QT_DEPLOY_PLUGINS_DIR in their deploy scripts to avoid
149hard-coding a particular directory under which to deploy plugins.
150
151\c QT_DEPLOY_PLUGINS_DIR defaults to the value \c{plugins}. To change the value
152of \c QT_DEPLOY_PLUGINS_DIR, set it in the project deployment script
153before \c QT_DEPLOY_SUPPORT is included.
154
155The \c QT_DEPLOY_PLUGINS_DIR path is relative to \l{QT_DEPLOY_PREFIX}.
156
157This variable is not meaningful when deploying into a macOS app bundle and
158should not be used for that scenario. Apple's macOS app bundle guidelines
159require all plugins to be deployed to the \c{PlugIns} subdirectory of the
160bundle contents.
161
162\section1 Example
163
164\include cmake-deploy-modified-variable-values.qdocinc
165
166\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR, QT_DEPLOY_LIB_DIR,
167 QT_DEPLOY_QML_DIR, QT_DEPLOY_TRANSLATIONS_DIR
168*/
169
170/*!
171\page cmake-variable-qt-deploy-qml-dir.html
172\ingroup cmake-variables-qtcore
173
174\title QT_DEPLOY_QML_DIR
175\target cmake-variable-QT_DEPLOY_QML_DIR
176
177\summary {Prefix-relative subdirectory for deploying QML plugins on some target platforms.}
178
179\include cmake-deploy-var-usage.qdocinc
180
181\cmakevariablesince 6.3
182
183Projects should use \c QT_DEPLOY_QML_DIR in their deploy scripts to avoid
184hard-coding a particular directory under which to deploy QML modules.
185
186\c QT_DEPLOY_QML_DIR defaults to the value \c{qml}. To change the value
187of \c QT_DEPLOY_QML_DIR, set it in the project deployment script
188before \c QT_DEPLOY_SUPPORT is included.
189
190The \c QT_DEPLOY_QML_DIR path is relative to \l{QT_DEPLOY_PREFIX}.
191
192This variable is not meaningful when deploying into a macOS app bundle and
193should not be used for that scenario. Apple's macOS app bundle guidelines
194require all plugins to be deployed to the \c{PlugIns} subdirectory of the
195bundle contents, and all other non-binary files should generally be under the
196\c{Resources} subdirectory. The different parts of a QML module therefore need
197to be deployed to different locations within the app bundle.
198
199\section1 Example
200
201\include cmake-deploy-modified-variable-values.qdocinc
202
203\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR, QT_DEPLOY_LIB_DIR,
204 QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_TRANSLATIONS_DIR
205*/
206
207/*!
208\page cmake-variable-qt-deploy-translations-dir.html
209\ingroup cmake-variables-qtcore
210
211\title QT_DEPLOY_TRANSLATIONS_DIR
212\target cmake-variable-QT_DEPLOY_TRANSLATIONS_DIR
213
214\summary {Prefix-relative subdirectory for deploying Qt translations on some target platforms.}
215
216\include cmake-deploy-var-usage.qdocinc
217
218\cmakevariablesince 6.5
219
220Projects should use \c QT_DEPLOY_TRANSLATIONS_DIR in their deploy scripts to
221avoid hard-coding a particular directory under which to deploy translations.
222
223\c QT_DEPLOY_TRANSLATIONS_DIR defaults to the value \c{translations}. To change
224the value of \c QT_DEPLOY_TRANSLATIONS_DIR, set it in the project deployment
225script before \c QT_DEPLOY_SUPPORT is included.
226
227The \c QT_DEPLOY_TRANSLATIONS_DIR path is relative to \l{QT_DEPLOY_PREFIX}.
228
229This variable is not meaningful when deploying on macOS or Windows.
230
231\section1 Example
232
233\include cmake-deploy-modified-variable-values.qdocinc
234
235\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR, QT_DEPLOY_LIB_DIR,
236 QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR
237*/
238
239/*!
240\page cmake-variable-qt-deploy-ignored-lib-dirs.html
241\ingroup cmake-variables-qtcore
242
243\title QT_DEPLOY_IGNORED_LIB_DIRS
244\target cmake-variable-QT_DEPLOY_IGNORED_LIB_DIRS
245
246\summary {Directories that are excluded from runtime dependencies search}
247
248\include cmake-deploy-var-usage.qdocinc
249
250\cmakevariablesince 6.5
251
252This variable contains a list of directories that are not taken into account
253when searching for runtime dependencies with \l{qt_deploy_runtime_dependencies}.
254
255Projects may alter this variable before calling
256\l{qt_deploy_runtime_dependencies} to control from which directory runtime
257dependencies are deployed.
258
259This variable is ignored if the \c{POST_EXCLUDE_REGEXES} option is specified in
260the \l{qt_deploy_runtime_dependencies} call.
261
262This variable is not meaningful when deploying on macOS or Windows.
263
264\sa qt_deploy_runtime_dependencies
265*/