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_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 qt6_deploy_qt_conf
10
11\summary {Write a qt.conf file at deployment time.}
12
13\include cmake-find-package-core.qdocinc
14
15Unlike most other CMake commands provided by Qt, \c{qt_deploy_qt_conf()} can
16only be called from a deployment script. It cannot be called directly by the
17project.
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
27qt_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
47Use this command when you need to generate a \l{Using qt.conf}{qt.conf} file
48during deployment. The default value of any path supported by \c{qt.conf} can
49be overridden with the corresponding \c{..._DIR} option. The command will only
50write a path to the generated \c{qt.conf} file if it differs from the default
51value.
52The default values can be found at \l{Overriding Paths}.
53
54The \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}
56variables can be used to dynamically specify a path relative to the deployment binary directory,
57as shown in the example below. This helps avoid hard-coding an absolute path.
58
59\sa {qt6_generate_deploy_app_script}{qt_generate_deploy_app_script()},
60 {qt6_deploy_runtime_dependencies}{qt_deploy_runtime_dependencies()}
61
62\section1 Example
63
64\badcode
65# The following script must only be executed at install time
66qt_generate_deploy_script(
67 OUTPUT_SCRIPT deploy_script
68 CONTENT "
69qt_deploy_qt_conf(\"\${QT_DEPLOY_PREFIX}/\${QT_DEPLOY_BIN_DIR}/qt.conf\"
70 DATA_DIR \"./custom_data_dir\"
71 TRANSLATIONS_DIR \"./custom_translations_dir\"
72)
73")
74
75install(SCRIPT ${deploy_script})
76\endcode
77
78*/