이 페이지에서

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 앱 번들 지침에 따르면 모든 플러그인은 번들 콘텐츠의 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_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을 참조하십시오.

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