diff options
Diffstat (limited to 'src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc')
-rw-r--r-- | src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc | 107 |
1 files changed, 55 insertions, 52 deletions
diff --git a/src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc b/src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc index 103fad3761..31d9e4384b 100644 --- a/src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc +++ b/src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc @@ -1,50 +1,36 @@ -/**************************************************************************** -** -** Copyright (C) 2021 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! -\page qt_generate_deploy_app_script.html +\page qt-generate-deploy-app-script.html \ingroup cmake-commands-qtcore \title qt_generate_deploy_app_script -\target qt6_generate_deploy_app_script +\keyword qt6_generate_deploy_app_script \summary {Generate a deployment script for an application.} \include cmake-find-package-core.qdocinc -\preliminarycmakecommand +\cmakecommandsince 6.3 +\note This command is currently only supported on Windows, macOS, and Linux. \section1 Synopsis \badcode qt_generate_deploy_app_script( TARGET target - FILENAME_VARIABLE var_name + OUTPUT_SCRIPT <var> + [NO_TRANSLATIONS] + [NO_COMPILER_RUNTIME] [NO_UNSUPPORTED_PLATFORM_ERROR] + [DEPLOY_TOOL_OPTIONS ...] + [PRE_INCLUDE_REGEXES regexes...] + [PRE_EXCLUDE_REGEXES regexes...] + [POST_INCLUDE_REGEXES regexes...] + [POST_EXCLUDE_REGEXES regexes...] + [POST_INCLUDE_FILES files...] + [POST_EXCLUDE_FILES files...] ) \endcode @@ -63,45 +49,62 @@ determined by \l{GNUInstallDirs} (except for macOS app bundles, which follow Apple's requirements instead). The command generates a script whose name will be stored in the variable named -by the \c{FILENAME_VARIABLE} option. That script is only written at CMake +by the \c{OUTPUT_SCRIPT} option. That script is only written at CMake generation time. It is intended to be used with the \l{install(SCRIPT)} command, which should come after the application's target has been installed using \l{install(TARGETS)}. -The deployment script will call \l{qt_deploy_runtime_dependencies()} with a -suitable set of options for the standard install layout. This is currently only -implemented for macOS app bundles and Windows targets. -Calling \c{qt_generate_deploy_app_script()} for any other platform will result +The deployment script will call \l{qt6_deploy_runtime_dependencies} +{qt_deploy_runtime_dependencies()} with a suitable set of options for the standard +install layout. Currently, this is only implemented for +\list + \li macOS app bundles built on a macOS host, + \li Linux executables built on a Linux host, + \li and Windows executables built on a Windows host. +\endlist +Cross-building a Windows executable on a Linux host, as well as similar +scenarios, are not currently supported. +Calling \c{qt_generate_deploy_app_script()} in such a case will result in a fatal error, unless the \c{NO_UNSUPPORTED_PLATFORM_ERROR} option is given. +On platforms other than macOS, Qt translations are automatically deployed. To +inhibit this behavior, specify \c{NO_TRANSLATIONS}. Use +\l{qt6_deploy_translations}{qt_deploy_translations()} to deploy translations in a +customized way. + +For Windows desktop applications, the required runtime files for the compiler +are also installed by default. To prevent this, specify \c{NO_COMPILER_RUNTIME}. + +Since Qt 6.7, you can use \c{DEPLOY_TOOL_OPTIONS} to pass additional options to +the underlying deployment tool. This only has an effect if the underlying +deployment tool is either macdeployqt or windeployqt. + For deploying a QML application, use \l{qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()} instead. +For generating a custom deployment script, use +\l{qt6_generate_deploy_script}{qt_generate_deploy_script}. + +The options \c{PRE_INCLUDE_REGEXES}, \c{PRE_EXCLUDE_REGEXES}, +\c{POST_INCLUDE_REGEXES}, \c{POST_EXCLUDE_REGEXES}, \c{POST_INCLUDE_FILES}, and +\c{POST_EXCLUDE_FILES} can be specified to control the deployment of runtime +dependencies. These options do not apply to all platforms and are forwarded +unmodified to \l{qt6_deploy_runtime_dependencies}{qt_deploy_runtime_dependencies()}. + \sa {qt6_standard_project_setup}{qt_standard_project_setup()}, + {qt6_generate_deploy_script}{qt_generate_deploy_script()}, {qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()} \section1 Example -\badcode -cmake_minimum_required(VERSION 3.16...3.22) -project(MyThings) +The following example shows how to deploy an application \c{MyApp}. -find_package(Qt6 REQUIRED COMPONENTS Core) -qt_standard_project_setup() +\include cmake-generate-deploy-app-script.qdocinc -qt_add_executable(MyApp main.cpp) +The following example shows how to use the \c{DEPLOY_TOOL_OPTIONS} parameter to +pass different options to macdeployqt and windeployqt. -install(TARGETS MyApp - BUNDLE DESTINATION . - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) +\include cmake-generate-deploy-app-script-deploy-tool-options.qdocinc -qt_generate_deploy_app_script( - TARGET MyApp - FILENAME_VARIABLE deploy_script - NO_UNSUPPORTED_PLATFORM_ERROR -) -install(SCRIPT ${deploy_script}) -\endcode */ |