Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.1.0 Beta3
Description
It's currently not (easily) possible to determine Qt's version from Qt's CMake targets.
CMake code like this
function(load_my_packages) find_package(Qt6 COMPONENTS Core) endfunction() load_my_packages()
will load Qt6::Core, but Qt's version will be written into variables that stay within the function's scope. It would be nice to be able to retrieve the Qt version from some target property of Qt6::Core.
This came up when working on https://gitlab.kitware.com/cmake/cmake/-/issues/22028 which requires executing moc to retrieve Qt's version.