pretend autogenerated headers are system ones

This commit is contained in:
Albert Astals Cid 2023-07-23 16:40:28 +02:00 committed by Albert Vaca Cintora
parent 7091f333f9
commit 7860280158

View file

@ -1,12 +1,12 @@
add_definitions(-DTRANSLATION_DOMAIN=\"kdeconnect-interfaces\") add_definitions(-DTRANSLATION_DOMAIN=\"kdeconnect-interfaces\")
function(geninterface source_h output_h) 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}) qt_generate_dbus_interface( ${source_h} ${xml_file})
set_source_files_properties(${xml_file} PROPERTIES NO_NAMESPACE true) 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) set(libkdeconnect_SRC ${libkdeconnect_SRC} PARENT_SCOPE)
endfunction() endfunction()
@ -71,6 +71,10 @@ set_target_properties(kdeconnectinterfaces PROPERTIES
SOVERSION ${KDECONNECT_VERSION_MAJOR} 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) generate_export_header(kdeconnectinterfaces EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectinterfaces_export.h BASE_NAME KDEConnectInterfaces)
target_link_libraries(kdeconnectinterfaces target_link_libraries(kdeconnectinterfaces