diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index f46d703f2f0..574d8cc86c2 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -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(