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
20qt_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
32The command generates a script whose full file path will be stored in the
33variable named by the \c{OUTPUT_SCRIPT} option. That script is only written
34at CMake generation time. It is intended to be used with the \l{install(SCRIPT)}
35command, which should come after the application's target has been installed
36using \l{install(TARGETS)}.
37
38The command takes care of generating a file named suitably for multi-config
39generators. Necessary includes are added such that Qt's CMake deployment
40functions and variables are accessible.
41
42The \c TARGET argument specifies the target that will be deployed by the script.
43This affects the file name of the generated script, unless \c NAME is specified.
44
45The \c NAME argument controls an identifiable portion within the deployment
46script's automatically generated name. The \c NAME argument defaults to \c
47custom if neither \c NAME nor \c TARGET are given.
48
49The \c CONTENT argument specifies the code that is written to the deployment
50script. The content may contain generator expressions.
51
52\note When using the version-less \l qt_generate_deploy_script command,
53escape sequences and \c{${var}} references in the content only reach the
54generated script unchanged if \l {QTP0008} is set to \c NEW. With the \c OLD
55behavior they are evaluated at the call site while the arguments are forwarded,
56so a \c{QT_DEPLOY_*} reference that is meant to be expanded when the script runs,
57instead gets expanded at configure time, leading to an empty value.
58Calling \c qt6_generate_deploy_script() directly avoids this issue.
59
60This command is intended for generating custom deployment scripts that
61directly call functions of Qt's deployment API. For less complex
62deployment 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*/