qt_deploy_qt_conf

デプロイ時に qt.conf ファイルを書き込みます。

このコマンドはQt6 パッケージのCore コンポーネントで定義されています:

find_package(Qt6 REQUIRED COMPONENTS Core)

Qt が提供する他の CMake コマンドとは異なり、qt_deploy_qt_conf() はデプロイ スクリプトからのみ呼び出すことができます。Qt が提供する他のほとんどの CMake コマンドとは異なり、 はデプロイスクリプトからのみ呼び出すことができます。

このコマンドは Qt 6.3 で導入されました。

注意: 通常、このコマンドを直接呼び出す必要はありません。このコマンドは他の上位のコマンドによって内部的に使用されますが、よりカスタマイズされたデプロイメントロジックを実装したいプロジェクトには便利です。

概要

qt_deploy_qt_conf(file_path
    [PREFIX prefix]
    [DOC_DIR doc_dir]
    [HEADERS_DIR headers_dir]
    [LIB_DIR lib_dir]
    [LIBEXEC_DIR libexec_dir]
    [BIN_DIR bin_dir]
    [PLUGINS_DIR plugins_dir]
    [QML_DIR qml_dir]
    [ARCHDATA_DIR archdata_dir]
    [DATA_DIR data_dir]
    [TRANSLATIONS_DIR translations_dir]
    [EXAMPLES_DIR examples_dir]
    [TESTS_DIR test_dir]
    [SETTINGS_DIR settings_dir]
)

説明

デプロイ時にqt.confファイルを生成する必要がある場合にこのコマンドを使用します。qt.conf でサポートされているパスのデフォルト値は、対応する..._DIR オプションで上書きできます。このコマンドは、生成されたqt.conf ファイルのパスがデフォルト値と異なる場合にのみ、そのパスを書き込みます。デフォルト値はパスの上書きで確認できる。

file_path 引数には、qt.conf ファイルが書き込まれる場所への絶対パスを指定します。QT_DEPLOY_PREFIXおよびQT_DEPLOY_BIN_DIR変数を使用すると、下の例に示すように、デプロイメント・バイナリー・ディレクトリからの相対パスを動的に指定できます。これにより、絶対パスをハードコーディングする必要がなくなります。

# The following script must only be executed at install time
qt_generate_deploy_script(
    OUTPUT_SCRIPT deploy_script
    CONTENT "
qt_deploy_qt_conf(\"\${QT_DEPLOY_PREFIX}/\${QT_DEPLOY_BIN_DIR}/qt.conf\"
    DATA_DIR \"./custom_data_dir\"
    TRANSLATIONS_DIR \"./custom_translations_dir\"
)
")

install(SCRIPT ${deploy_script})

qt_generate_deploy_app_script()およびqt_deploy_runtime_dependencies()も参照してください

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.