summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/src/cmake/cmake-deploy-variables.qdoc
blob: 0c9d66812ae7bbea3dbd29fca4f41ee417f0c75a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/* NOTE: The variables documented here are available when running a deploy
**       script, they are not available at configure time (i.e. when running
**       CMake). Both these and the set of configure-time variables are all
**       members of the cmake-variables-qtcore group.
**/

/*!
\page cmake-variable-QT_DEPLOY_PREFIX.html
\ingroup cmake-variables
\ingroup cmake-variables-qtcore

\title QT_DEPLOY_PREFIX
\target cmake-variable-QT_DEPLOY_PREFIX

\summary {Base location for a deployment.}

\include cmake-deploy-var-usage.qdocinc

\preliminarycmakevariable

\c{QT_DEPLOY_PREFIX} provides the base directory of the deployment. The other
\c{QT_DEPLOY_..._DIR} variables should be treated as relative to this location.
The value of \c{QT_DEPLOY_PREFIX} may be relative or absolute, so projects
should not assume one or the other in any given situation. A relative path is
expected to be treated as relative to the current working directory.

The default value is \c{$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}}, which is the
base location CMake uses during installation. If that evaluates to an empty
string, the default value will be a dot (.) instead, which is generally the
appropriate value when deploying as part of a post-build rule. This two-step
fallback logic ensures that projects can assume \c{QT_DEPLOY_PREFIX} will not
be an empty string, so it can safely be used as part of a path like
\c{${QT_DEPLOY_PREFIX}/${QT_DEPLOY_BIN_DIR}}.

Projects should rarely need to use this variable. In typical scenarios, deploy
scripts should assume that the working directory is already set to the base
install location and just use the prefix-relative \c{QT_DEPLOY_..._DIR}
variables.

\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_BIN_DIR, QT_DEPLOY_LIB_DIR,
    QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR
*/

/*!
\page cmake-variable-QT_DEPLOY_BIN_DIR.html
\ingroup cmake-variables
\ingroup cmake-variables-qtcore

\title QT_DEPLOY_BIN_DIR
\target cmake-variable-QT_DEPLOY_BIN_DIR

\summary {Prefix-relative subdirectory for deploying runtime binaries on some target platforms.}

\include cmake-deploy-var-usage.qdocinc

\preliminarycmakevariable

Projects should use \c QT_DEPLOY_BIN_DIR in their deploy scripts instead of
hard-coding a particular directory in which to deploy the following types of
binaries:

\list
\li Executables on all platforms.
\li DLLs on Windows.
\endlist

\c QT_DEPLOY_BIN_DIR defaults to the value of \c${CMAKE_INSTALL_BINDIR}, which
is provided by CMake's \l{GNUInstallDirs} module.

This variable is not meaningful when deploying into a macOS app bundle and
should not be used for that scenario.

\section1 Example

\include cmake-deploy-runtime-dependencies.qdocinc

\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_LIB_DIR,
    QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR
*/

/*!
\page cmake-variable-QT_DEPLOY_LIB_DIR.html
\ingroup cmake-variables
\ingroup cmake-variables-qtcore

\title QT_DEPLOY_LIB_DIR
\target cmake-variable-QT_DEPLOY_LIB_DIR

\summary {Prefix-relative subdirectory for deploying libraries on some target platforms.}

\include cmake-deploy-var-usage.qdocinc

\preliminarycmakevariable

Projects should use \c QT_DEPLOY_LIB_DIR in their deploy scripts instead of
hard-coding a particular directory in which to deploy the following types of
binaries:

\list
\li Shared libraries on platforms other than Windows.
\li Import libraries on Windows.
\endlist

\c QT_DEPLOY_LIB_DIR defaults to the value of \c${CMAKE_INSTALL_LIBDIR}, which
is provided by CMake's \l{GNUInstallDirs} module.

This variable is not meaningful when deploying into a macOS app bundle and
should not be used for that scenario.

\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR,
    QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR
*/

/*!
\page cmake-variable-QT_DEPLOY_PLUGINS_DIR.html
\ingroup cmake-variables
\ingroup cmake-variables-qtcore

\title QT_DEPLOY_PLUGINS_DIR
\target cmake-variable-QT_DEPLOY_PLUGINS_DIR

\summary {Prefix-relative subdirectory for deploying Qt plugins on some target platforms.}

\include cmake-deploy-var-usage.qdocinc

\preliminarycmakevariable

Projects should use \c QT_DEPLOY_PLUGINS_DIR in their deploy scripts instead of
hard-coding a particular directory under which to deploy plugins.

\c QT_DEPLOY_PLUGINS_DIR defaults to the value \c{plugins}.

This variable is not meaningful when deploying into a macOS app bundle and
should not be used for that scenario. Apple's macOS app bundle guidelines
require all plugins to be deployed to the \c{PlugIns} subdirectory of the
bundle contents.

\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR, QT_DEPLOY_LIB_DIR,
    QT_DEPLOY_QML_DIR
*/

/*!
\page cmake-variable-QT_DEPLOY_QML_DIR.html
\ingroup cmake-variables
\ingroup cmake-variables-qtcore

\title QT_DEPLOY_QML_DIR
\target cmake-variable-QT_DEPLOY_QML_DIR

\summary {Prefix-relative subdirectory for deploying QML plugins on some target platforms.}

\include cmake-deploy-var-usage.qdocinc

\preliminarycmakevariable

Projects should use \c QT_DEPLOY_QML_DIR in their deploy scripts instead of
hard-coding a particular directory under which to deploy QML modules.

\c QT_DEPLOY_QML_DIR defaults to the value \c{qml}.

This variable is not meaningful when deploying into a macOS app bundle and
should not be used for that scenario. Apple's macOS app bundle guidelines
require all plugins to be deployed to the \c{PlugIns} subdirectory of the
bundle contents, and all other non-binary files should generally be under the
\c{Resources} subdirectory. The different parts of a QML module therefore need
to be deployed to different locations within the app bundle.

\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR, QT_DEPLOY_LIB_DIR,
    QT_DEPLOY_PLUGINS_DIR
*/