qt_deploy_plugins_dir

いくつかのターゲットプラットフォームで Qt プラグインをデプロイするための、 プレフィックス関連のサブディレクトリ。

この変数はQT_DEPLOY_SUPPORT で指定されたスクリプトで定義されます。インストール中のデプロイの一部として、またはビルド後のルールとしてのみ使用する必要があります。

注意: これは低レベルのデプロイメント API 変数であり、qt_generate_deploy_app_script のような高レベルの API コマンドではカバーできない高度な使用例でのみ使用してください。

この変数は Qt 6.3 で導入されました。

プロジェクトは、プラグインをデプロイする特定のディレクトリをハードコーディングしないように、デプロイスクリプトでQT_DEPLOY_PLUGINS_DIR を使うべきです。

QT_DEPLOY_PLUGINS_DIR のデフォルト値は です。 の値を変更するには、 がインクルードされる前に、プロジェクトのデプロイスクリプトで設定します。plugins QT_DEPLOY_PLUGINS_DIR QT_DEPLOY_SUPPORT

QT_DEPLOY_PLUGINS_DIR のパスはQT_DEPLOY_PREFIX からの相対パスです。

この変数は、macOS アプリバンドルにデプロイするときには意味がないので、そのシナリオでは使用しないでください。Apple の macOS app bundle ガイドラインでは、すべてのプラグインをバンドルコンテンツのPlugIns サブディレクトリにデプロイする必要があります。

cmake_minimum_required(VERSION 3.16...3.22)
project(MyThings)

# The following CMAKE_INSTALL_*DIR variables are used to initialize their
# QT_DEPLOY_*_DIR counterparts.
set(CMAKE_INSTALL_BINDIR "mybindir")
set(CMAKE_INSTALL_LIBDIR "mylibdir")
set(CMAKE_INSTALL_LIBEXECDIR "mylibexecdir")

find_package(Qt6 REQUIRED COMPONENTS Core)
qt_standard_project_setup()

qt_add_executable(MyApp main.cpp)

set(deploy_script "${CMAKE_CURRENT_BINARY_DIR}/deploy_MyApp.cmake")
file(GENERATE OUTPUT ${deploy_script} CONTENT "

set(QT_DEPLOY_PLUGINS_DIR \"mypluginsdir\")
set(QT_DEPLOY_QML_DIR \"myqmldir\")
set(QT_DEPLOY_TRANSLATIONS_DIR \"i18n\")

include(\"${QT_DEPLOY_SUPPORT}\")

qt_deploy_runtime_dependencies(
    EXECUTABLE \"\${QT_DEPLOY_BIN_DIR}/$<TARGET_FILE_NAME:MyApp>\"
)")

install(SCRIPT ${deploy_script})

QT_DEPLOY_SUPPORT,QT_DEPLOY_PREFIX,QT_DEPLOY_BIN_DIR,QT_DEPLOY_LIBEXEC_DIR,QT_DEPLOY_LIB_DIR,QT_DEPLOY_QML_DIR,QT_DEPLOY_TRANSLATIONS_DIRも参照してください

© 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.