W3cubDocs

/Qt

qt_add_dbus_interfaces

Generates C++ sources implementing interfaces for D-Bus interface description files.

The command is defined in the DBus component of the Qt6 package. Load the package with:

find_package(Qt6 COMPONENTS DBus REQUIRED)

Synopsis

qt_add_dbus_interfaces(<VAR> dbus_spec1 [dbus_spec2 ...])

If versionless commands are disabled, use qt6_add_dbus_interfaces() instead. It supports the same set of arguments as this command.

Description

Generates C++ sources implementing D-Bus interfaces defined in dbus_spec1, dbus_spec2, where each argument needs to be the path to a valid D-Bus interface description file. The paths of the generated files are added to <VAR>.

For each argument, a call to the Qt D-Bus XML compiler (qdbusxml2cpp) in interface (proxy) mode is set up.

The generated C++ source files are named after the XML file: For the file org.example.chat.xml the generated header will be named orgexamplechatinterface.h.

Options

Options can be set using set_source_file_property on each of the file arguments:

Option Value Description
CLASSNAME class_name Override the default interface class name with class_name.
NO_NAMESPACE boolean Do not generate the namespaced name if set to ON.
INCLUDE path Add an #include "path" in the generated code.

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.2/qtdbus-cmake-qt-add-dbus-interfaces.html