From 185cf1ca3b1188973cc7996c7df8128d3a476638 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 Sep 2021 15:10:00 +0200 Subject: CMake: Use new __QT_INTERNAL_OUTPUT_MOC_JSON_FILES option in API The implementation of _qt_internal_add_repc_files and qt6_reps_from_headers were using qt_manual_moc which is internal API not available for user projects. Use the newly introduced __QT_INTERNAL_OUTPUT_MOC_JSON_FILES in qtbase's qt6_wrap_cpp to run moc and extract the metatypes json files. Fixes: QTBUG-95832 Change-Id: I64969478a2c1226aa0b73d458acd30c695d7521e Reviewed-by: Fabian Kosmale Reviewed-by: Joerg Bornemann (cherry picked from commit 7e58270087f705ab1b5b499c0849baac6a2f56ea) Reviewed-by: Qt CI Bot --- src/remoteobjects/Qt6RemoteObjectsMacros.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/remoteobjects/Qt6RemoteObjectsMacros.cmake b/src/remoteobjects/Qt6RemoteObjectsMacros.cmake index fe12eb9..21b764e 100644 --- a/src/remoteobjects/Qt6RemoteObjectsMacros.cmake +++ b/src/remoteobjects/Qt6RemoteObjectsMacros.cmake @@ -53,7 +53,8 @@ function(_qt_internal_add_repc_files type target) get_filename_component(outfilename ${it} NAME_WE) get_filename_component(extension ${it} EXT) if ("${extension}" STREQUAL ".h" OR "${extension}" STREQUAL ".hpp") - qt_manual_moc(qtro_moc_files OUTPUT_MOC_JSON_FILES json_list ${it}) + qt6_wrap_cpp(qtro_moc_files "${it}" + __QT_INTERNAL_OUTPUT_MOC_JSON_FILES json_list) set(infile ${json_list}) set_source_files_properties(${qtro_moc_files} PROPERTIES HEADER_FILE_ONLY ON) list(APPEND outfiles ${qtro_moc_files}) @@ -99,7 +100,8 @@ function(qt6_reps_from_headers target) list(POP_FRONT ARGV) foreach(it ${ARGV}) get_filename_component(outfilename ${it} NAME_WE) - qt_manual_moc(qtro_moc_files OUTPUT_MOC_JSON_FILES json_list ${it}) + qt6_wrap_cpp(qtro_moc_files "${it}" + __QT_INTERNAL_OUTPUT_MOC_JSON_FILES json_list) set(infile ${json_list}) set_source_files_properties(${qtro_moc_files} PROPERTIES HEADER_FILE_ONLY ON) list(APPEND outfiles ${qtro_moc_files}) -- cgit v1.2.3