QT_DEPLOY_PREFIX | Qt Core | Qt 6.11.0
Description: Base location for a deployment.

- Qt 6.11
- Qt Core
- CMake Variables in Qt6 Core
- QT_DEPLOY_PREFIX
- Qt 6.11.0 Reference Documentation

# QT_DEPLOY_PREFIX

Base location for a deployment.

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

`QT_DEPLOY_PREFIX` provides the base deployment directory. The other `QT_DEPLOY_..._DIR` variables should be treated as relative to this location. The value of `QT_DEPLOY_PREFIX` may be relative or absolute, so projects should not assume one or the other in any given situation. A relative path is expected to be treated as relative to the current working directory, as seen by the build tool (ninja, make, and so on) at install time.

The default value is `$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}`, which is the base location CMake uses during installation. If that evaluates to an empty string, the default value will be a dot (.) instead, which is generally the appropriate value when deploying as part of a post-build rule. This two-step fallback logic ensures that projects can assume `QT_DEPLOY_PREFIX` will not be an empty string, so it can safely be used as part of a path like `${QT_DEPLOY_PREFIX}/${QT_DEPLOY_BIN_DIR}`.

To change the value of `QT_DEPLOY_PREFIX`, the project can be configured with a custom CMAKE_INSTALL_PREFIX as described in Command Line cmake invocation.

The DESTDIR environment variable can also be used to modify the final installation, and thus deployment, location.

Projects should rarely need to use this variable. In typical scenarios, deploy scripts should assume that the working directory is already set to the base install location and just use the prefix-relative `QT_DEPLOY_..._DIR` variables.

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