1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
5\page qt-deploy-qt-conf.html
6\ingroup cmake-commands-qtcore
8\title qt_deploy_qt_conf
9\keyword qt6_deploy_qt_conf
11\summary {Write a qt.conf file at deployment time.}
13\include cmake-find-package-core.qdocinc
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
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.
27qt_deploy_qt_conf(file_path
30 [HEADERS_DIR headers_dir]
32 [LIBEXEC_DIR libexec_dir]
34 [PLUGINS_DIR plugins_dir]
36 [ARCHDATA_DIR archdata_dir]
38 [TRANSLATIONS_DIR translations_dir]
39 [EXAMPLES_DIR examples_dir]
41 [SETTINGS_DIR settings_dir]
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
52The default values can be found at \l{Overriding Paths}.
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.
59\sa {qt6_generate_deploy_app_script}{qt_generate_deploy_app_script()},
60 {qt6_deploy_runtime_dependencies}{qt_deploy_runtime_dependencies()}
65# The following script must only be executed at install time
66qt_generate_deploy_script(
67 OUTPUT_SCRIPT deploy_script
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\"
75install(SCRIPT ${deploy_script})