/****************************************************************************
**
** 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_import_qml_plugins.html
\ingroup cmake-commands-qtqml

\title qt_import_qml_plugins
\target qt6_import_qml_plugins

\brief Ensures QML plugins needed by a target are imported for static builds.

\cmakecommandsince 6.0

\section1 Synopsis

\badcode
qt_import_qml_plugins(target)
\endcode

\versionlessCMakeCommandsNote qt6_import_qml_plugins()

\section1 Description

\note This command only has any effect if Qt was built statically. If called
      using a non-static Qt, it will do nothing and return immediately.

\c{qt_import_qml_plugins()} runs \c{qmlimportscanner} on the \c target
immediately as part of the call. It finds the static QML plugins used by the
\c target and links it to those plugins so that they are part of the executable
or shared library that \c target represents. The search follows QML module
imports recursively.

Because the call to \c{qmlimportscanner} runs at configure time rather than
generation or build time, \c{qt_import_qml_plugins()} only knows about the
information recorded on the \c target (or other targets it links or imports)
at the time \c{qt_import_qml_plugins()} is called. Any linking or import
relationships added after this call will not be considered. Therefore, this
command should be called as late as possible in the \c{target}'s directory
scope so that all the linking and import relationships are known.

If \c target was created using \l{qt6_add_executable}{qt_add_executable()},
projects would not normally need to call \c{qt_import_qml_plugins()} directly.
When Qt is built statically, the command is called automatically as part of
\l{qt6_add_executable#Finalization}{target finalization} if \c target links to
the Qml library. By default, this finalization occurs at the end of the same
directory scope in which the \c target was created. If the \c target was
created using the standard CMake \c{add_executable()} command instead, the
project needs to call \c{qt_import_qml_plugins()} itself.

\sa Q_IMPORT_QML_PLUGIN

*/
