이 페이지에서

qt_deploy_qt_conf

배포 시점에 qt.conf 파일을 생성합니다.

이 명령어는 Qt6 패키지의 Core 컴포넌트에 정의되어 있으며, 다음과 같이 로드할 수 있습니다:

find_package(Qt6 REQUIRED COMPONENTS Core)

Qt에서 제공하는 대부분의 다른 CMake 명령과 달리, qt_deploy_qt_conf() 는 배포 스크립트에서만 호출할 수 있습니다. 프로젝트에서 직접 호출할 수는 없습니다.

이 명령어는 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 변수를 사용하면 아래 예제와 같이 배포 바이너리 디렉터리를 기준으로 한 상대 경로를 동적으로 지정할 수 있습니다. 이를 통해 절대 경로를 하드코딩하는 것을 피할 수 있습니다.

예시

참고: 아래예제는 생성된 스크립트가 실행될 때 ${QT_DEPLOY_PREFIX} 및 ${QT_DEPLOY_BIN_DIR} 이 확장되도록 의도되었습니다. 이는 QTP0008이 NEW 로 설정된 경우에만 작동합니다. OLD 동작을 사용할 경우, 인수가 전달되는 동안 두 참조 모두 확장되며, 생성된 스크립트에는 qt_deploy_qt_conf("//qt.conf") 가 포함됩니다.

# The following script must only be executed at install time
qt_policy(SET QTP0008 NEW)

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() 및 QTP0008항목도 참조하십시오 .

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