Warn if using CMake 3.20.0 due to potential cyclic dependencies

CMake 3.20.0 can create autogen-related cyclic dependencies that are
only detected at build time by Ninja, which then fails with a build error.
Warn and advise to use a different CMake version instead.

Change-Id: I9bef973ad2efdb69f28d6a9e0584b543be59f17f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 6442116078500b0e7c401430b74bd40f32cfafb4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Craig Scott 2021-03-30 11:35:00 +11:00 committed by Qt Cherry-pick Bot
parent 79a7137d00
commit 5748c3ccb1

View File

@ -116,6 +116,11 @@ function(qt_internal_warn_about_unsuitable_cmake_versions)
# https://gitlab.kitware.com/cmake/cmake/-/issues/21163
list(APPEND unsuitable_versions "3.18.2")
# Cyclic dependencies are created when mixing AUTOMOC/AUTOUIC with sources
# that have their SKIP_MOC or SKIP_UIC source file properties set to true.
# https://gitlab.kitware.com/cmake/cmake/-/issues/21977
list(APPEND unsuitable_versions "3.20.0")
foreach(unsuitable_version ${unsuitable_versions})
if(CMAKE_VERSION VERSION_EQUAL unsuitable_version)
message(WARNING