diff options
Diffstat (limited to 'src/corelib/doc/src/cmake/qt_policy.qdoc')
-rw-r--r-- | src/corelib/doc/src/cmake/qt_policy.qdoc | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/corelib/doc/src/cmake/qt_policy.qdoc b/src/corelib/doc/src/cmake/qt_policy.qdoc new file mode 100644 index 0000000000..6deb7a729c --- /dev/null +++ b/src/corelib/doc/src/cmake/qt_policy.qdoc @@ -0,0 +1,65 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! +\page qt-policy.html +\ingroup cmake-commands-qtcore + +\title qt_policy +\keyword qt6_policy + +\summary {Modify the default behavior of Qt's CMake API.} + +\include cmake-find-package-core.qdocinc + +\cmakecommandsince 6.5 + +\section1 Synopsis + +\badcode +qt_policy( + [SET <policy_name> behavior] + [GET <policy_name> <variable>] +) +\endcode + +\versionlessCMakeCommandsNote qt6_policy() + +\section1 Description + +This command has two modes: + +\list +\li When the \c{SET} keyword is used, this command can be used to opt in to + behavior changes in Qt's CMake API, or to explicitly opt out of them. +\li When the \c{GET} keyword is used, \c{<variable>} is set to the current + behavior for the policy, i.e. \c OLD or \c NEW. +\endlist + +\c{<policy_name>} must be the name of one of the \l{Qt CMake policies}. +Policy names have the form of \c{QTP<NNNN>} where <NNNN> is +an integer specifying the index of the policy. Using an invalid policy +name results in an error. + +Code supporting older Qt versions can check the existence of a policy by +checking the value of the \c{QT_KNOWN_POLICY_<policy_name>} variable before +getting the value of \c <policy_name> or setting its behavior. + +\badcode +if(QT_KNOWN_POLICY_<policy_name>) + qt_policy(SET <policy_name> NEW) +endif() +\endcode + +You can set \c behavior to one of the following options: + +\list +\li \c{NEW} to opt into the new behavior +\li \c{OLD} to explicitly opt-out of it +\endlist + +\qtpolicydeprecatedbehavior + +\sa qt_standard_project_setup + +*/ |