이 페이지에서

qt_import_qml_plugins

정적 빌드 시 타깃에 필요한 QML 플러그인이 임포트되도록 보장합니다.

이 명령어는 Qt 6.0에서 도입되었습니다.

이 명령어는 Qt6 패키지의 Qml 구성 요소에 정의되어 있으며, 다음과 같이 불러올 수 있습니다:

find_package(Qt6 REQUIRED COMPONENTS Qml)

사용법

qt_import_qml_plugins(target)

버전 정보가 없는 명령어가 비활성화된 경우, 대신 qt6_import_qml_plugins() 을 사용하십시오. 이 명령어는 본 명령어와 동일한 인자 세트를 지원합니다.

설명

참고: 이 명령은 Qt가 정적(static)으로 빌드된 경우에만 효과가 있습니다. 비정적(non-static) Qt를 사용하여 호출하면 아무 작업도 수행하지 않고 즉시 반환됩니다.

qt_import_qml_plugins() 호출의 일환으로 즉시 target 에서 ` qmlimportscanner `를 실행합니다(QML 모듈을 정의할 때 `qt_add_qml_module() `에 ` NO_IMPORT_SCAN ` 옵션이 전달되지 않은 경우). 이 명령어는 ` target `에서 사용하는 정적 QML 플러그인을 찾아, ` target `가 나타내는 실행 파일 또는 공유 라이브러리의 일부가 되도록 해당 플러그인과 연결합니다. 검색은 QML 모듈의 임포트 문서를 재귀적으로 추적합니다.

qmlimportscanner 호출은 생성 또는 빌드 시점이 아닌 configure 시점에 실행되므로, qt_import_qml_plugins() 는 qt_import_qml_plugins() 가 호출된 시점에 target (또는 이 모듈이 링크하거나 임포트하는 다른 대상)에 기록된 정보만 인식합니다. 이 호출 이후에 추가된 링크 또는 임포트 관계는 고려되지 않습니다. 따라서 모든 링크 및 임포트 관계를 파악할 수 있도록, 이 명령은 target 디렉터리 범위 내에서 가능한 한 늦은 시점에 호출되어야 합니다.

target 가 qt_add_executable()을 사용하여 생성된 경우, 프로젝트에서는 일반적으로 qt_import_qml_plugins() 를 직접 호출할 필요가 없습니다. Qt가 정적으로 빌드될 때, target 가 Qml 라이브러리에 링크되어 있다면 이 명령은 타겟 마무리 과정의 일부로 자동으로 호출됩니다. 기본적으로 이 마무리 작업은 target 가 생성된 디렉터리 범위 끝에서 수행됩니다. 대신 표준 CMake add_executable() 명령을 사용하여 target 가 생성된 경우, 프로젝트에서 qt_import_qml_plugins() 를 직접 호출해야 합니다.

Q_IMPORT_QML_PLUGIN도 참조하십시오 .

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