aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-07-21 17:41:57 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-07-27 09:31:19 +0000
commitabed2215b2bdd1ca92c1a7b27cf64459212b0209 (patch)
tree00229b835d4a4f37956c83bd91df4d3b8639661d
parent97baab98faac7f16400e224dcc5c6b81343ba9f0 (diff)
CMake: Remove CMake minimum version check in top-level project
The check is done in qtbase instead. Trying to do it in the top-level project is cumbersome due to needing to know whether it will be a static or shared Qt build. It's also cumbersome because the top-level build used to use qtbase's minimum cmake version values and that can get awkward to handle with submodule dependency updates. Replace the check with a regular minimum required call. The minimum version is 3.16 and the upper range value for NEW policy assignments is 3.20, while 3.21.0 is still kind of fresh and has some AUTOUIC issues. As a drive-by, add a clarifying comment about QtAutoDetect.cmake. Task-number: QTBUG-95018 Change-Id: Ifb4ec0b4ed7f56ab0179feb79072c93d1d66ce63 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 4180e9c5111faae9b242253e2ab215154174507d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--CMakeLists.txt12
1 files changed, 7 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6baa7067..ed25c225 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,11 +1,13 @@
-set(__qt6_qtbase_src_path "${CMAKE_CURRENT_SOURCE_DIR}/qtbase")
+# The real minimum version will be checked by the qtbase project.
+# 3.16 is the absolute minimum though.
+cmake_minimum_required(VERSION 3.16...3.20)
+# Include qtbase's .cmake.conf for access to QT_REPO_MODULE_VERSION
+set(__qt6_qtbase_src_path "${CMAKE_CURRENT_SOURCE_DIR}/qtbase")
include("${__qt6_qtbase_src_path}/.cmake.conf")
-include("${__qt6_qtbase_src_path}/cmake/QtCMakeVersionHelpers.cmake")
-qt_internal_check_for_suitable_cmake_version()
-qt_internal_get_computed_minimum_cmake_version(__qt_minimum_cmake_version)
-cmake_minimum_required(VERSION ${__qt_minimum_cmake_version})
+# Run platform auto-detection /before/ the first project() call and thus
+# before the toolchain file is loaded.
include("${__qt6_qtbase_src_path}/cmake/QtAutoDetect.cmake")
project(Qt