diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-01-08 14:31:26 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-01-14 17:00:55 +0100 |
commit | 20a17911576297f22b9da9849b677476c2d6e0ea (patch) | |
tree | 11c7df5817f38bf39990c34f01e7d7a0efdb03e9 | |
parent | a2db96e253856aaabe10fe3bad6409dd047533a5 (diff) | |
download | qtbase-20a17911576297f22b9da9849b677476c2d6e0ea.tar.gz |
Lower the CMake minimum required version for single-config builds
Ubuntu 20.04 is a supported platform and comes with CMake 3.16. The
current state of the Qt build works fine with this CMake version, mainly
because the default build on Linux is single-config.
For multi-config builds we have higher version requirements as
documented in cmake/README.md.
This lowers the barrier for users using single-config builds who don't
want or cannot upgrade to CMake >= 3.18.
For Ninja Multi-Config builds, which were introduced by CMake 3.17, we
yield a warning that 3.18.3 is the lowest supported version.
Pick-to: 6.0
Change-Id: Ia918b9f2b494508e86301ffc0e138d3ad4dbaf86
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r-- | .cmake.conf | 2 | ||||
-rw-r--r-- | cmake/QtCMakeVersionHelpers.cmake | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/.cmake.conf b/.cmake.conf index b470bd0d02..8744479d6f 100644 --- a/.cmake.conf +++ b/.cmake.conf @@ -1,7 +1,7 @@ set(QT_REPO_MODULE_VERSION "6.1.0") # Minimum requirement for building Qt -set(QT_MIN_SUPPORTED_CMAKE_VERSION "3.18") +set(QT_MIN_SUPPORTED_CMAKE_VERSION "3.16") # Policy settings for commands defined by qtbase. These will also be injected # into the top level policy scope of each Qt module when building Qt so that diff --git a/cmake/QtCMakeVersionHelpers.cmake b/cmake/QtCMakeVersionHelpers.cmake index aca1c50206..955d9044cb 100644 --- a/cmake/QtCMakeVersionHelpers.cmake +++ b/cmake/QtCMakeVersionHelpers.cmake @@ -124,6 +124,16 @@ function(qt_internal_warn_about_unsuitable_cmake_versions) "CMake version used: '${unsuitable_version}'") endif() endforeach() + + # Ninja Multi-Config was introduced in 3.17, but we recommend 3.18. + set(min_nmc_cmake_version "3.18.3") + if(CMAKE_GENERATOR STREQUAL "Ninja Multi-Config" + AND CMAKE_VERSION VERSION_LESS ${min_nmc_cmake_version}) + message(WARNING + "You are using CMake ${CMAKE_VERSION} with the Ninja Multi-Config generator. " + "This combination is unsupported. " + "Please upgrade to at least CMake ${min_nmc_cmake_version}. ") + endif() endfunction() # Functions don't have their own policy scope, so the policy settings modified |