[Development] Raising minimum CMake version to 3.16 for Qt6

EXT Craig Scott craig.scott at qt.io
Wed May 5 06:51:36 CEST 2021


Some Qt modules rely on being able to extract metatypes from a CMake target. That logic, implemented in the qt6_extract_metatypes() command from Qt6CoreMacros.cmake, requires CMake behavior that was added in CMake 3.16. The implementation of that command checks this and halts with an error if CMake 3.15 or earlier is detected. That check has been there since Qt 6.0.0-alpha1. To our knowledge, there have been no bug reports related to this constraint.

Until now, we’ve been aiming to make CMake 3.14 the minimum version for user projects (it is higher for building Qt itself). The above demonstrates that we actually require 3.16 and have done so since the beginning of Qt6. Right now, this might only have affected projects that were using or depended on qtdeclarative, although my understanding is that users of qtremoteobjects might also be affected.

Given that we haven’t received any reports about this from user projects in the year since the code added this constraint, and that we expect to rely more on the metatypes going forward rather than less, the CMake Ports team proposes to raise the minimum CMake version for user projects to CMake 3.16. From what we can tell, the original target of 3.14 was likely based on the CMake versions available in major Linux distributions at the time, but 3.16 or later now seems to be widely enough available (Ubuntu 20.04 is the main blocker for being able to go any higher than 3.16).


Craig Scott





More information about the Development mailing list