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.7 6.6 6.5
Fixes: QTBUG-120317
Change-Id: I3d15f23937133a5dd4d1c2a88af0fc34d5608a77
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2024-02-02 11:24:02 +01:00
parent 97c02b80ae
commit 654f3c5634

View File

@ -1425,7 +1425,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(