diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 1c2199bb28..c1ea6fde58 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -2738,8 +2738,8 @@ macro(qt6_standard_project_setup) set(__qt_sps_args_option) set(__qt_sps_args_single - MIN_VERSION - MAX_VERSION + REQUIRES + SUPPORTS_UP_TO ) set(__qt_sps_args_multi) cmake_parse_arguments(__qt_sps_arg @@ -2764,22 +2764,22 @@ macro(qt6_standard_project_setup) else() message(FATAL_ERROR "Can not determine Qt version.") endif() - if(__qt_sps_arg_MIN_VERSION) - if("${__qt_current_version}" VERSION_LESS "${__qt_sps_arg_MIN_VERSION}") + if(__qt_sps_arg_REQUIRES) + if("${__qt_current_version}" VERSION_LESS "${__qt_sps_arg_REQUIRES}") 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}.") endif() - set(__qt_policy_check_version "${__qt_sps_arg_MIN_VERSION}") + set(__qt_policy_check_version "${__qt_sps_arg_REQUIRES}") endif() - if(__qt_sps_arg_MAX_VERSION) - if(__qt_sps_arg_MIN_VERSION) - if(${__qt_sps_arg_MAX_VERSION} VERSION_LESS ${__qt_sps_arg_MIN_VERSION}) - message(FATAL_ERROR "MAX_VERSION must be larger than or equal to MIN_VERSION.") + if(__qt_sps_arg_SUPPORTS_UP_TO) + if(__qt_sps_arg_REQUIRES) + if(${__qt_sps_arg_SUPPORTS_UP_TO} VERSION_LESS ${__qt_sps_arg_REQUIRES}) + message(FATAL_ERROR "SUPPORTS_UP_TO must be larger than or equal to REQUIRES.") endif() - set(__qt_policy_check_version "${__qt_sps_arg_MAX_VERSION}") + set(__qt_policy_check_version "${__qt_sps_arg_SUPPORTS_UP_TO}") else() - message(FATAL_ERROR "Please specify the MIN_VERSION as well.") + message(FATAL_ERROR "Please specify the REQUIRES as well.") endif() endif() diff --git a/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc b/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc index 0b386b6c42..c76eba42f2 100644 --- a/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc +++ b/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc @@ -18,8 +18,8 @@ \badcode qt_standard_project_setup( - [MIN_VERSION ] - [MAX_VERSION ] + [REQUIRES ] + [SUPPORTS_UP_TO ] ) \endcode @@ -51,11 +51,11 @@ have been defined. It does the following things: \endlist 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 -specified, all suggested changes introduced in Qt up to \c{MIN_VERSION} are enabled, +API by opting in to changes from newer Qt versions. If \c{REQUIRES} is +specified, all suggested changes introduced in Qt up to \c{REQUIRES} are enabled, and using an older Qt version will result in an error. -If additionally \c{MAX_VERSION} has been specified, any new changes introduced -in versions up to \c{MAX_VERSION} are also enabled (but using an older Qt +If additionally \c{SUPPORTS_UP_TO} has been specified, any new changes introduced +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 (compare \l{cmake_policy}).