Skip to content

Commit

Permalink
CMake: Bump min required CMake version for shared Qt builds to 3.16
Browse files Browse the repository at this point in the history
Building a shared library Qt configuration already required a minimum
CMake version of 3.16, because we depend on CMake's Autogen.json files
which are used for metatype.json file generation.

If a lower version was used, a FATAL_ERROR was issued in
qt6_extract_metatypes.

This change is essentially moving the check to happen earlier in the
qtbase configure process.

User projects will now /also/ officially require a minimum of 3.16
(up from 3.14).

As a consequence, the min/max version policy range that is set in
the public QtFooConfig.cmake files is changed
from 3.14..3.19
to   3.16..3.20

The upper bound is raised because building and using Qt works fine
with all CMake 3.20 policies set to NEW.

[ChangeLog][CMake] Building Qt as shared libraries now requires
CMake version 3.16 or later. Building user projects with CMake using
that Qt installation also requires a CMake version of 3.16 or later.

Pick-to: 6.2
Task-number: QTBUG-95018
Change-Id: I77d2829370f1dfc90b4071bebc8a3ade654e59e6
Reviewed-by: Alexey Edelev <[email protected]>
Reviewed-by: Alexandru Croitor <[email protected]>
Reviewed-by: Craig Scott <[email protected]>
Reviewed-by: Qt CI Bot <[email protected]>
  • Loading branch information
alcroito committed Jul 28, 2021
1 parent 0a8aa8c commit 42970e4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .cmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ set(QT_MIN_SUPPORTED_CMAKE_VERSION "3.16")
# because that file is used in-place by a superbuild, so there is no
# opportunity for substituting the values from here. Keep both locations
# in sync.
set(QT_MIN_NEW_POLICY_CMAKE_VERSION "3.14")
set(QT_MAX_NEW_POLICY_CMAKE_VERSION "3.19")
set(QT_MIN_NEW_POLICY_CMAKE_VERSION "3.16")
set(QT_MAX_NEW_POLICY_CMAKE_VERSION "3.20")
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# Need an explicit call at the top level. This is the absolute minimum version
# needed to configure the project with any combination of enabled features.
# The call to qt_build_repo_begin() will upgrade policies further.
#
# The absolute minimum version for building Qt is 3.16 because for metatype.json generation, we
# depend on being able to find the location of json files created by AUTOMOC/moc.
cmake_minimum_required(VERSION 3.16)

# Get the repo version and CMake policy details
Expand Down
2 changes: 1 addition & 1 deletion cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# These values should be kept in sync with those in qtbase/.cmake.conf
cmake_minimum_required(VERSION 3.14...3.19)
cmake_minimum_required(VERSION 3.16...3.20)

###############################################
#
Expand Down

0 comments on commit 42970e4

Please sign in to comment.