The CMake API needs to be adjusted to make this more convenient, but the
test shows that the basic idea works.
Pick-to: 6.2
Change-Id: I523069f33f8e3a8418224b8872b191d4229548b0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>