summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@qt.io>2021-11-24 13:35:41 +1100
committerAlexandru Croitor <alexandru.croitor@qt.io>2021-12-08 19:50:21 +0100
commit22c92f39670d0376478cc2e73a17307508f86692 (patch)
tree87fd705bad0c02414b03deb674ae810b6dbdb159 /src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc
parent3ee79be6280119afd5d1fb98df4320f0b105aa47 (diff)
Add documentation for CMake deployment support
Task-number: QTBUG-98545 Change-Id: Ifd5c0f4ce278c683bb0d3ba6a259ec14a7f24181 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc')
-rw-r--r--src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc90
1 files changed, 90 insertions, 0 deletions
diff --git a/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc b/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc
new file mode 100644
index 0000000000..6c3fcc3f93
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+/*!
+\page qt_standard_project_setup.html
+\ingroup cmake-commands-qtcore
+
+\title qt_standard_project_setup
+\target qt6_standard_project_setup
+
+\summary {Setup project-wide defaults to a standard arrangement.}
+
+\include cmake-find-package-core.qdocinc
+
+\section1 Synopsis
+
+\badcode
+qt_standard_project_setup()
+\endcode
+
+\versionlessCMakeCommandsNote qt6_standard_project_setup()
+
+\section1 Description
+
+This command simplifies the task of setting up a typical Qt application.
+It would usually be called immediately after the first \c{find_package(Qt6)}
+call, normally in the top level \c{CMakeLists.txt} file and before any targets
+have been defined. It does the following things:
+
+\list
+\li The standard CMake variables \c{CMAKE_AUTOMOC}, \c{CMAKE_AUTOUIC} and
+ \c{CMAKE_AUTORCC} are set to true if they are not already defined.
+ This enables all Qt-related autogen features by default for subsequently
+ created targets in the current directory scope and below.
+\li CMake's \l{GNUInstallDirs} module is automatically included. This defines
+ appropriate defaults for variables like \c{CMAKE_INSTALL_BINDIR},
+ \c{CMAKE_INSTALL_LIBDIR}, and so on.
+\li When targeting Windows, if the \c{CMAKE_RUNTIME_OUTPUT_DIRECTORY} variable
+ is not already set, it will be set to
+ \c{${CMAKE_CURRENT_BINARY_DIR}}.
+\li When target platforms other than Apple or Windows, \c{CMAKE_INSTALL_RPATH}
+ will be augmented as described below.
+\endlist
+
+On platforms that support \c{RPATH} (other than Apple platforms), two values
+are appended to the \c{CMAKE_INSTALL_RPATH} variable by this command.
+\c{$ORIGIN} is appended so that libraries will find other libraries they depend
+on in the same directory as themselves. \c{$ORIGIN/<reldir>} is also appended,
+where \c{<reldir>} is the relative path from \c{CMAKE_INSTALL_BINDIR} to
+\c{CMAKE_INSTALL_LIBDIR}. This allows executables installed to
+\c{CMAKE_INSTALL_BINDIR} to find any libraries they may depend on installed to
+\c{CMAKE_INSTALL_LIBDIR}. Any duplicates in \c{CMAKE_INSTALL_RPATH} are
+removed. In practice, these two values ensure that executables and libraries
+will find their link-time dependencies, assuming projects install them to the
+default locations the \l{install(TARGETS)} command uses when no destination is
+explicitly provided.
+
+The \c{qt_standard_project_setup()} command can effectively be disabled by
+setting the \l{QT_NO_STANDARD_PROJECT_SETUP} variable to true.
+
+\sa {qt6_generate_deploy_app_script}{qt_generate_deploy_app_script()}
+
+\section1 Example
+
+\include cmake-deploy-runtime-dependencies.qdocinc
+*/