Name of the file to include for setting up deployment support.
This variable was introduced in Qt 6.3.
注意: This variable is in technology preview and may change in future releases.
注意: The value of this variable should never be modified by project code.
This configure-phase variable is set by the Core package. It is intended to be used as the first line of any deployment script to ensure access to the deployment APIs provided by Qt. Such deployment scripts do not run during CMake's configure phase, they are executed during installation or as part of a post-build rule.
The following example shows one way the variable would be used when installing an application, along with its runtime dependencies:
cmake_minimum_required(VERSION 3.16...3.22) project(MyThings) set(CMAKE_INSTALL_BINDIR "mybindir") set(CMAKE_INSTALL_LIBDIR "mylibdir") 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_runtime_dependencies() and qt_deploy_qml_imports() .