QT_DEPLOY_LIBEXEC_DIR
Präfix-relatives Unterverzeichnis für die Bereitstellung von Programmdateien auf einigen Zielplattformen.
Diese Variable wird durch das von QT_DEPLOY_SUPPORT benannte Skript definiert. Sie sollte nur als Teil der Bereitstellung während der Installation oder als Post-Build-Regel verwendet werden.
Hinweis: Dies ist eine Low-Level-Deployment-API-Variable und sollte nur in fortgeschrittenen Anwendungsfällen verwendet werden, die nicht von den API-Befehlen auf höherer Ebene, wie qt_generate_deploy_app_script, abgedeckt werden.
Diese Variable wurde in Qt 6.7 eingeführt.
Auf Unix-Derivaten sollten Projekte QT_DEPLOY_LIBEXEC_DIR
in ihren Deploy-Skripten verwenden, um zu vermeiden, dass ein bestimmtes Verzeichnis hart kodiert wird, in dem ausführbare Hilfsdateien bereitgestellt werden, die für das Projekt lokal sind.
Projekte, die QtWebEngine verwenden, würden zum Beispiel die ausführbare Datei QtWebEngineProcess
in diesem Verzeichnis bereitstellen.
QT_DEPLOY_LIBEXEC_DIR
ist standardmäßig auf den Wert von ${CMAKE_INSTALL_LIBEXECDIR}
(normalerweise libexec
) eingestellt, der vom CMake-Modul GNUInstallDirs bereitgestellt wird. Um den Wert von QT_DEPLOY_LIBEXEC_DIR
zu ändern, stellen Sie sicher, dass das Projekt CMAKE_INSTALL_LIBEXECDIR
setzt, bevor das Paket Core
gefunden wird.
Der Pfad QT_DEPLOY_LIBEXEC_DIR
ist relativ zu QT_DEPLOY_PREFIX.
Diese Variable ist bei der Bereitstellung in einem macOS-App-Bundle nicht sinnvoll und sollte in diesem Szenario nicht verwendet werden.
Beispiel
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})
Siehe auch QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR, QT_DEPLOY_LIB_DIR, QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR, und 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.