From aa99bf532da51fc024c70e989e54b014e4cec199 Mon Sep 17 00:00:00 2001 From: Mate Barany Date: Wed, 13 Jul 2022 16:39:08 +0200 Subject: qdbusxml2cpp: modify the behavior of -m/--moc option qdbusxml2cpp has a -m/--moc option. Change and modify the behavior such that -p foo -m includes moc_foo.cpp in the generated .cpp -p :foo.cpp includes moc_foo.cpp in the generated .cpp -p foo.h:foo.cpp includes moc_foo.cpp in the generated .cpp Change the Qt6DbusMacros.cmake file accordingly. [ChangeLog][qdbusxml2cpp] The -m/--moc option now generates idiomatic moc file names (moc_base.cpp for headers, base.moc for implementation files)(was: always base.moc). Build systems using workarounds for the non-idiomatic naming of moc files used by qdbusxml2cpp in the past can now drop these workarounds for Qt versions >= 6.5. Fixes: QTBUG-103313 Change-Id: I754b1b276f130cb8645166470e1b457a676590f7 Reviewed-by: Thiago Macieira Reviewed-by: Qt CI Bot Reviewed-by: Alexey Edelev Reviewed-by: Marc Mutz --- src/dbus/Qt6DBusMacros.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/dbus') diff --git a/src/dbus/Qt6DBusMacros.cmake b/src/dbus/Qt6DBusMacros.cmake index 97f6e0fcc7..7c76ed5bf3 100644 --- a/src/dbus/Qt6DBusMacros.cmake +++ b/src/dbus/Qt6DBusMacros.cmake @@ -10,7 +10,7 @@ function(qt6_add_dbus_interface _sources _interface _basename) get_filename_component(_infile ${_interface} ABSOLUTE) set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h") set(_impl "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp") - set(_moc "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc") + set(_moc "${CMAKE_CURRENT_BINARY_DIR}/moc_${_basename}.cpp") get_source_file_property(_nonamespace ${_interface} NO_NAMESPACE) if(_nonamespace) @@ -42,7 +42,7 @@ function(qt6_add_dbus_interface _sources _interface _basename) qt6_generate_moc("${_header}" "${_moc}") - list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}") + list(APPEND ${_sources} "${_impl}" "${_header}") macro_add_file_dependencies("${_impl}" "${_moc}") set(${_sources} ${${_sources}} PARENT_SCOPE) endfunction() @@ -156,7 +156,7 @@ function(qt6_add_dbus_adaptor _sources _xml_file _include) # _optionalParentClas set(_optionalClassName "${ARGV5}") set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h") set(_impl "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp") - set(_moc "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc") + set(_moc "${CMAKE_CURRENT_BINARY_DIR}/moc_${_basename}.cpp") if(_optionalClassName) add_custom_command(OUTPUT "${_impl}" "${_header}" @@ -179,7 +179,7 @@ function(qt6_add_dbus_adaptor _sources _xml_file _include) # _optionalParentClas ) macro_add_file_dependencies("${_impl}" "${_moc}") - list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}") + list(APPEND ${_sources} "${_impl}" "${_header}") set(${_sources} ${${_sources}} PARENT_SCOPE) endfunction() -- cgit v1.2.3