Rename Qt CMake policies argument names

We decided to go with REQUIRES/SUPPORTS_UP_TO.

Task-number: QTBUG-96233
Change-Id: Ia82d22618d31c06b5260a632ba079eeba7a506e0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 04a3e411ec0b961f2561a749f9e8f27a498c954c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Amir Masoud Abdol 2023-02-07 13:12:18 +01:00 committed by Qt Cherry-pick Bot
parent b66a83b74e
commit ea2c76147d
2 changed files with 18 additions and 18 deletions

View File

@ -2705,8 +2705,8 @@ macro(qt6_standard_project_setup)
set(__qt_sps_args_option) set(__qt_sps_args_option)
set(__qt_sps_args_single set(__qt_sps_args_single
MIN_VERSION REQUIRES
MAX_VERSION SUPPORTS_UP_TO
) )
set(__qt_sps_args_multi) set(__qt_sps_args_multi)
cmake_parse_arguments(__qt_sps_arg cmake_parse_arguments(__qt_sps_arg
@ -2731,22 +2731,22 @@ macro(qt6_standard_project_setup)
else() else()
message(FATAL_ERROR "Can not determine Qt version.") message(FATAL_ERROR "Can not determine Qt version.")
endif() endif()
if(__qt_sps_arg_MIN_VERSION) if(__qt_sps_arg_REQUIRES)
if("${__qt_current_version}" VERSION_LESS "${__qt_sps_arg_MIN_VERSION}") if("${__qt_current_version}" VERSION_LESS "${__qt_sps_arg_REQUIRES}")
message(FATAL_ERROR message(FATAL_ERROR
"Project required a Qt minimum version of ${__qt_sps_arg_MIN_VERSION}, " "Project required a Qt minimum version of ${__qt_sps_arg_REQUIRES}, "
"but current version is only ${__qt_current_version}.") "but current version is only ${__qt_current_version}.")
endif() endif()
set(__qt_policy_check_version "${__qt_sps_arg_MIN_VERSION}") set(__qt_policy_check_version "${__qt_sps_arg_REQUIRES}")
endif() endif()
if(__qt_sps_arg_MAX_VERSION) if(__qt_sps_arg_SUPPORTS_UP_TO)
if(__qt_sps_arg_MIN_VERSION) if(__qt_sps_arg_REQUIRES)
if(${__qt_sps_arg_MAX_VERSION} VERSION_LESS ${__qt_sps_arg_MIN_VERSION}) if(${__qt_sps_arg_SUPPORTS_UP_TO} VERSION_LESS ${__qt_sps_arg_REQUIRES})
message(FATAL_ERROR "MAX_VERSION must be larger than or equal to MIN_VERSION.") message(FATAL_ERROR "SUPPORTS_UP_TO must be larger than or equal to REQUIRES.")
endif() endif()
set(__qt_policy_check_version "${__qt_sps_arg_MAX_VERSION}") set(__qt_policy_check_version "${__qt_sps_arg_SUPPORTS_UP_TO}")
else() else()
message(FATAL_ERROR "Please specify the MIN_VERSION as well.") message(FATAL_ERROR "Please specify the REQUIRES as well.")
endif() endif()
endif() endif()

View File

@ -18,8 +18,8 @@
\badcode \badcode
qt_standard_project_setup( qt_standard_project_setup(
[MIN_VERSION <version>] [REQUIRES <version>]
[MAX_VERSION <version>] [SUPPORTS_UP_TO <version>]
) )
\endcode \endcode
@ -51,11 +51,11 @@ have been defined. It does the following things:
\endlist \endlist
Since Qt 6.5, it is possible to change the default behavior of Qt's CMake Since Qt 6.5, it is possible to change the default behavior of Qt's CMake
API by opting in to changes from newer Qt versions. If \c{MIN_VERSION} is API by opting in to changes from newer Qt versions. If \c{REQUIRES} is
specified, all suggested changes introduced in Qt up to \c{MIN_VERSION} are enabled, specified, all suggested changes introduced in Qt up to \c{REQUIRES} are enabled,
and using an older Qt version will result in an error. and using an older Qt version will result in an error.
If additionally \c{MAX_VERSION} has been specified, any new changes introduced If additionally \c{SUPPORTS_UP_TO} has been specified, any new changes introduced
in versions up to \c{MAX_VERSION} are also enabled (but using an older Qt in versions up to \c{SUPPORTS_UP_TO} are also enabled (but using an older Qt
version is not an error). This is similar to CMake's policy concept version is not an error). This is similar to CMake's policy concept
(compare \l{cmake_policy}). (compare \l{cmake_policy}).