It's currently not (easily) possible to determine Qt's version from Qt's CMake targets.
CMake code like this
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.