Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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 qt6_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
52This command is intended for generating custom deployment scripts that
53directly call functions of Qt's deployment API. For less complex
54deployment purposes, it is more convenient to use
55\l{qt6_generate_deploy_app_script}{qt_generate_deploy_app_script()} or
56\l{qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()}.
57
58\sa {qt6_generate_deploy_app_script}{qt_generate_deploy_app_script()},
59 {qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()}
60
61\section1 Example
62
63\snippet cmake-macros/deployment.cmake qt_generate_deploy_script_example
64
65*/