CMake: Fix *-metatypes.json creation, take III

Use the work-around for CMake issue #19005 for Makefile generators
and Visual Studio projects.

Pick-to: 6.6 6.5
Fixes: QTBUG-120317
Change-Id: I3d15f23937133a5dd4d1c2a88af0fc34d5608a77
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 654f3c5634ac9efc2257177351c8dea7c8d8875a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Joerg Bornemann 2024-02-02 11:24:02 +01:00 committed by Qt Cherry-pick Bot
parent d5134f2123
commit 907497b87d

View File

@ -1371,7 +1371,7 @@ function(qt6_extract_metatypes target)
VERBATIM
)
if(CMAKE_GENERATOR MATCHES " Makefiles")
if(CMAKE_GENERATOR MATCHES " Makefiles" OR CMAKE_GENERATOR MATCHES "^Visual Studio")
# Work around https://gitlab.kitware.com/cmake/cmake/-/issues/19005 to trigger the command
# that generates ${metatypes_file}.
add_custom_command(