Deploy

Gathering what a built or an installed binary needs to run, and putting it beside the binary. Windows is done after a build and every platform can be done during an install.

Warning

This module depends on qmcorecmd after installation.

qm_win_applocal_deps

Automatically copy dependencies for Windows Executables after build.

qm_win_applocal_deps(<target>
    [CUSTOM_TARGET <target>]
    [FORCE] [VERBOSE]
    [EXTRA_SEARCHING_PATHS <path...>]
    [OUTPUT_DIR <dir>]
    [EXCLUDE <pattern...>]
)

Does nothing where the platform is not Windows, so a call needs no guard around it.

See also

qm_deploy_directory(), for the same thing done while installing rather than after building.

qm_deploy_directory

Add a deploy command when installing the project. Not for a debug build.

qm_deploy_directory(<install_dir>
    [FORCE] [STANDARD] [VERBOSE]
    [LIBRARY_DIR <dir>]
    [EXTRA_LIBRARIES <path>...]
    [EXTRA_PLUGIN_PATHS <path>...]
    [EXTRA_SEARCHING_PATHS <path>...]

    [PLUGINS <plugin>...]
    [PLUGIN_DIR <dir>]

    [QML <qml>...]
    [QML_DIR <dir>]

    [COMMENT <comment>]
)
PLUGINS

Qt plugins, in format of <category>/<name>

PLUGIN_DIR

Qt plugins destination

EXTRA_PLUGIN_PATHS

Extra Qt plugins searching paths

QML

Qt qml directories

QML_DIR

Qt qml destination

LIBRARY_DIR

Library destination

EXTRA_LIBRARIES

Extra library names list to deploy

EXTRA_SEARCHING_PATHS

Extra library searching paths

What it gathers is the release flavour of everything, and that is decided in the scripts underneath rather than here. A plugin is looked for by the name it was given, so iconengines/qsvgicon finds qsvgicon.dll and never qsvgicond.dll, and a debug build beside a release one is turned down on sight. Unix leaves out anything whose name carries debug, which is how a macOS framework spells its debug library.

So nothing stops this being called in a debug build, and what it leaves is a release deployment. Nothing here reads the configuration, and the note above is the whole of the enforcement.

QML is the one thing here that cannot be asked for without a Qt, the modules being named relative to a directory only qmake can say where is. PLUGINS given EXTRA_PLUGIN_PATHS never reaches qmake.

Note

Where qmake is wanted it has to be found first, which qm_find_qt() with any component is the short way to. A call that needs it and does not have it stops with an error saying so.

EXTRA_LIBRARIES is matched against what is on disk while the project is being read, so it names neither a target of this build nor a generator expression.

Where this page comes from

The comments in cmake/modules/Deploy.cmake, which is what to change.