summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/QtBuild.cmake1
-rw-r--r--src/corelib/Qt6CoreMacros.cmake5
2 files changed, 5 insertions, 1 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index e9fcd38d0d..6ca625009d 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -1147,7 +1147,6 @@ function(qt_extend_target target)
${private_visibility_option} ${arg_LINK_OPTIONS})
if(NOT arg_HEADER_MODULE)
- list(APPEND arg_MOC_OPTIONS "--output-json")
set_target_properties("${target}" PROPERTIES
AUTOMOC_MOC_OPTIONS "${arg_MOC_OPTIONS}"
_qt_target_deps "${target_deps}"
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index 3857d46b36..446926cd73 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -707,6 +707,11 @@ function(qt6_generate_meta_types_json_file target)
endif()
endif()
+ # Tell automoc to output json files
+ set_property(TARGET "${target}" APPEND PROPERTY
+ AUTOMOC_MOC_OPTIONS "--output-json"
+ )
+
get_target_property(target_type ${target} TYPE)
if (target_type STREQUAL "INTERFACE_LIBRARY" OR CMAKE_VERSION VERSION_LESS "3.16.0")
# interface libraries not supported or cmake version is not high enough