From 799139c5197b2210952f1b6b720bc94f22b88ab8 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 2 Jan 2024 17:13:33 +0100 Subject: [PATCH] CMake: Fix *-metatypes.json creation for all makefile generators When using one of the non-Unix makefile generators ("NMake Makfiles JOM" or "MinGW Makefiles") then it possible to trigger an error when running qmltyperegistrar: ..._metatypes.json: illegal value We create the metatypes JSON file initially empty and then "fill" it with a custom command. This command is not triggered when using Makefile generators. See CMake upstream issue #19005. Our work-around for that issue was only triggered for the generator "Unix Makefiles". Now, it's triggered for all makefile generators. Pick-to: 6.5 6.6 Fixes: QTBUG-120317 Task-number: QTBUG-121472 Change-Id: I329cb0d3e9ba0997d618821e7bcbc20284561419 Reviewed-by: Alexandru Croitor (cherry picked from commit db9009721a11f482b601a228eb6d0e1658d997b0) Reviewed-by: Alexey Edelev --- src/corelib/Qt6CoreMacros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 3aed96f6bf5..868461dacab 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 "Unix Makefiles") + if(CMAKE_GENERATOR MATCHES " Makefiles") # Work around https://gitlab.kitware.com/cmake/cmake/-/issues/19005 to trigger the command # that generates ${metatypes_file}. add_custom_command(