From 7860280158285428ee9b4cae6715720b364d0ee5 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Sun, 23 Jul 2023 16:40:28 +0200 Subject: [PATCH] pretend autogenerated headers are system ones --- interfaces/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/interfaces/CMakeLists.txt b/interfaces/CMakeLists.txt index 28dce2eca..91a8c9547 100644 --- a/interfaces/CMakeLists.txt +++ b/interfaces/CMakeLists.txt @@ -1,12 +1,12 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kdeconnect-interfaces\") function(geninterface source_h output_h) - set(xml_file ${CMAKE_CURRENT_BINARY_DIR}/${output_h}.xml) + set(xml_file ${CMAKE_CURRENT_BINARY_DIR}/generated/${output_h}.xml) qt_generate_dbus_interface( ${source_h} ${xml_file}) set_source_files_properties(${xml_file} PROPERTIES NO_NAMESPACE true) - qt_add_dbus_interface(libkdeconnect_SRC ${xml_file} ${output_h}) + qt_add_dbus_interface(libkdeconnect_SRC ${xml_file} generated/${output_h}) set(libkdeconnect_SRC ${libkdeconnect_SRC} PARENT_SCOPE) endfunction() @@ -71,6 +71,10 @@ set_target_properties(kdeconnectinterfaces PROPERTIES SOVERSION ${KDECONNECT_VERSION_MAJOR} ) +# pretend the dbus generated headers are from the system so that clazy and other similar +# tools do not show warnings about their contents +target_include_directories(kdeconnectinterfaces SYSTEM PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/generated) + generate_export_header(kdeconnectinterfaces EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectinterfaces_export.h BASE_NAME KDEConnectInterfaces) target_link_libraries(kdeconnectinterfaces