- Qt 6.8
- Qt Core
- CMake Variables in Qt6 Core
- QT_DEPLOY_LIBEXEC_DIR
- Qt 6.8.1 Reference Documentation

# QT_DEPLOY_LIBEXEC_DIR

Prefix-relative subdirectory for deploying program executables on some target platforms.

This variable is defined by the script named by QT_DEPLOY_SUPPORT. It should only be used as part of deployment during installation or a post-build rule.

Note: This is a low-level deployment API variable, and should only be used in advanced use-cases that are not covered by the higher-level API commands, like qt_generate_deploy_app_script.

This variable was introduced in Qt 6.7.

On Unix derivatives, projects should use `QT_DEPLOY_LIBEXEC_DIR` in their deploy scripts to avoid hard-coding a particular directory in which to deploy helper executables that are local to the project.

For example, projects using QtWebEngine would deploy the `QtWebEngineProcess` executable to this directory.

`QT_DEPLOY_LIBEXEC_DIR` defaults to the value of `${CMAKE_INSTALL_LIBEXECDIR}` (usually `libexec`), which is provided by CMake's GNUInstallDirs module. To change the value of `QT_DEPLOY_LIBEXEC_DIR`, ensure that the project sets `CMAKE_INSTALL_LIBEXECDIR` before the `Core` package is found.

The `QT_DEPLOY_LIBEXEC_DIR` path is relative to QT_DEPLOY_PREFIX.

This variable is not meaningful when deploying into a macOS app bundle and should not be used for that scenario.

## Example

     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})

See also QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR, QT_DEPLOY_LIB_DIR, QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR, and QT_DEPLOY_TRANSLATIONS_DIR.