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_deploy_qt_conf.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2021 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
/*!
5
\page qt-deploy-qt-conf.html
6
\ingroup cmake-commands-qtcore
7
8
\title qt_deploy_qt_conf
9
\keyword qt_deploy_qt_conf()
10
11
\summary {Write a qt.conf file at deployment time.}
12
13
\include cmake-find-package-core.qdocinc
14
15
Unlike most other CMake commands provided by Qt, \c{qt_deploy_qt_conf()} can
16
only be called from a deployment script. It cannot be called directly by the
17
project.
18
19
\cmakecommandsince 6.3
20
\note This command does not usually need to be called directly. It is used
21
internally by other higher level commands, but projects wishing to
22
implement more customized deployment logic may find it useful.
23
24
\section1 Synopsis
25
26
\badcode
27
qt_deploy_qt_conf(file_path
28
[PREFIX prefix]
29
[DOC_DIR doc_dir]
30
[HEADERS_DIR headers_dir]
31
[LIB_DIR lib_dir]
32
[LIBEXEC_DIR libexec_dir]
33
[BIN_DIR bin_dir]
34
[PLUGINS_DIR plugins_dir]
35
[QML_DIR qml_dir]
36
[ARCHDATA_DIR archdata_dir]
37
[DATA_DIR data_dir]
38
[TRANSLATIONS_DIR translations_dir]
39
[EXAMPLES_DIR examples_dir]
40
[TESTS_DIR test_dir]
41
[SETTINGS_DIR settings_dir]
42
)
43
\endcode
44
45
\section1 Description
46
47
Use this command when you need to generate a \l{Using qt.conf}{qt.conf} file
48
during deployment. The default value of any path supported by \c{qt.conf} can
49
be overridden with the corresponding \c{..._DIR} option. The command will only
50
write a path to the generated \c{qt.conf} file if it differs from the default
51
value.
52
The default values can be found at \l{Overriding Paths}.
53
54
The \c file_path argument expects an absolute path to the location where the
55
\c qt.conf file should be written to. The \l{QT_DEPLOY_PREFIX} and \l{QT_DEPLOY_BIN_DIR}
56
variables can be used to dynamically specify a path relative to the deployment binary directory,
57
as shown in the example below. This helps avoid hard-coding an absolute path.
58
59
\sa qt_generate_deploy_app_script(),
60
qt_deploy_runtime_dependencies(),
61
{QTP0008}
62
63
\section1 Example
64
65
\note The example below intends for \c{${QT_DEPLOY_PREFIX}} and
66
\c{${QT_DEPLOY_BIN_DIR}} to be expanded when the generated script is run.
67
That only works with \l {QTP0008} set to \c NEW.
68
With the \c OLD behavior both references are expanded while the arguments are forwarded,
69
and the generated script ends up with \c{qt_deploy_qt_conf("//qt.conf")}.
70
71
\badcode
72
# The following script must only be executed at install time
73
qt_policy(SET QTP0008 NEW)
74
75
qt_generate_deploy_script(
76
OUTPUT_SCRIPT deploy_script
77
CONTENT "
78
qt_deploy_qt_conf(\"\${QT_DEPLOY_PREFIX}/\${QT_DEPLOY_BIN_DIR}/qt.conf\"
79
DATA_DIR \"./custom_data_dir\"
80
TRANSLATIONS_DIR \"./custom_translations_dir\"
81
)
82
")
83
84
install(SCRIPT ${deploy_script})
85
\endcode
86
87
*/
qtbase
src
corelib
doc
src
cmake
qt_deploy_qt_conf.qdoc
Generated on
for Qt by
1.16.1