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_script.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2022 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-script.html
6
\ingroup cmake-commands-qtcore
7
8
\title qt_generate_deploy_script
9
\keyword qt_generate_deploy_script()
10
11
\summary {Generate a custom deployment script.}
12
13
\include cmake-find-package-core.qdocinc
14
15
\cmakecommandsince 6.5
16
17
\section1 Synopsis
18
19
\badcode
20
qt_generate_deploy_script(
21
OUTPUT_SCRIPT <var>
22
[TARGET target]
23
[NAME script_name]
24
[CONTENT content]
25
)
26
\endcode
27
28
\versionlessCMakeCommandsNote qt6_generate_deploy_script()
29
30
\section1 Description
31
32
The command generates a script whose full file path will be stored in the
33
variable named by the \c{OUTPUT_SCRIPT} option. That script is only written
34
at CMake generation time. It is intended to be used with the \l{install(SCRIPT)}
35
command, which should come after the application's target has been installed
36
using \l{install(TARGETS)}.
37
38
The command takes care of generating a file named suitably for multi-config
39
generators. Necessary includes are added such that Qt's CMake deployment
40
functions and variables are accessible.
41
42
The \c TARGET argument specifies the target that will be deployed by the script.
43
This affects the file name of the generated script, unless \c NAME is specified.
44
45
The \c NAME argument controls an identifiable portion within the deployment
46
script's automatically generated name. The \c NAME argument defaults to \c
47
custom if neither \c NAME nor \c TARGET are given.
48
49
The \c CONTENT argument specifies the code that is written to the deployment
50
script. The content may contain generator expressions.
51
52
\note When using the version-less \l qt_generate_deploy_script command,
53
escape sequences and \c{${var}} references in the content only reach the
54
generated script unchanged if \l {QTP0008} is set to \c NEW. With the \c OLD
55
behavior they are evaluated at the call site while the arguments are forwarded,
56
so a \c{QT_DEPLOY_*} reference that is meant to be expanded when the script runs,
57
instead gets expanded at configure time, leading to an empty value.
58
Calling \c qt6_generate_deploy_script() directly avoids this issue.
59
60
This command is intended for generating custom deployment scripts that
61
directly call functions of Qt's deployment API. For less complex
62
deployment purposes, it is more convenient to use
63
\l qt_generate_deploy_app_script() or
64
\l qt_generate_deploy_qml_app_script().
65
66
\sa qt_generate_deploy_app_script(),
67
qt_generate_deploy_qml_app_script(),
68
{QTP0008}
69
70
\section1 Example
71
72
\snippet cmake-macros/deployment.cmake qt_generate_deploy_script_example
73
74
*/
qtbase
src
corelib
doc
src
cmake
qt_generate_deploy_script.qdoc
Generated on
for Qt by
1.16.1