summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/src/cmake/qt_generate_deploy_script.qdoc
blob: eb8ed402a9ba3a55dd4e74344a34d10db6550da2 (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
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
\page qt-generate-deploy-script.html
\ingroup cmake-commands-qtcore

\title qt_generate_deploy_script
\keyword qt6_generate_deploy_script

\summary {Generate a custom deployment script.}

\include cmake-find-package-core.qdocinc

\cmakecommandsince 6.5

\section1 Synopsis

\badcode
qt_generate_deploy_script(
    OUTPUT_SCRIPT <var>
    [TARGET target]
    [NAME script_name]
    [CONTENT content]
)
\endcode

\versionlessCMakeCommandsNote qt6_generate_deploy_script()

\section1 Description

The command generates a script whose full file path will be stored in the
variable named by the \c{OUTPUT_SCRIPT} option. That script is only written
at CMake generation time. It is intended to be used with the \l{install(SCRIPT)}
command, which should come after the application's target has been installed
using \l{install(TARGETS)}.

The command takes care of generating a file named suitably for multi-config
generators. Necessary includes are added such that Qt's CMake deployment
functions and variables are accessible.

The \c TARGET argument specifies the target that will be deployed by the script.
This affects the file name of the generated script, unless \c NAME is specified.

The \c NAME argument controls an identifiable portion within the deployment
script's automatically generated name. The \c NAME argument defaults to \c
custom if neither \c NAME nor \c TARGET are given.

The \c CONTENT argument specifies the code that is written to the deployment
script. The content may contain generator expressions.

This command is intended for generating custom deployment scripts that
directly call functions of Qt's deployment API. For less complex
deployment purposes, it is more convenient to use
\l{qt6_generate_deploy_app_script}{qt_generate_deploy_app_script()} or
\l{qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()}.

\sa {qt6_generate_deploy_app_script}{qt_generate_deploy_app_script()},
    {qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()}

\section1 Example

\snippet cmake-macros/deployment.cmake qt_generate_deploy_script_example

*/