summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/dbusadaptors.prf
blob: 241ace6112b02884534aa88d738fd48e701f797a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
isEmpty(QMAKE_QDBUSXML2CPP) {
    win32:QMAKE_QDBUSXML2CPP = $$[QT_INSTALL_BINS]\qdbusxml2cpp.exe
    else:QMAKE_QDBUSXML2CPP = $$[QT_INSTALL_BINS]/qdbusxml2cpp
}

for(DBUS_ADAPTOR, $$list($$unique(DBUS_ADAPTORS))) {

    !contains(DBUS_ADAPTOR, .*\w\.xml$) {
        warning("Invalid D-BUS adaptor: '$${DBUS_ADAPTOR}', please use 'com.mydomain.myinterface.xml' instead.")
        next()
    }

    DBUS_ADAPTOR_LIST += $${DBUS_ADAPTOR}
}

dbus_adaptor_header.commands = $$QMAKE_QDBUSXML2CPP -a ${QMAKE_FILE_OUT}: ${QMAKE_FILE_IN}
dbus_adaptor_header.output_function = dbus_adaptor_header_output
dbus_adaptor_header.name = DBUSXML2CPP ADAPTOR HEADER ${QMAKE_FILE_IN}
dbus_adaptor_header.variable_out = DBUS_ADAPTOR_HEADERS
dbus_adaptor_header.input = DBUS_ADAPTOR_LIST

defineReplace(dbus_adaptor_header_output) {
    return("$$lower($$section($$list($$basename(1)),.,-2,-2))_adaptor.h")
}

dbus_adaptor_source.commands = $$QMAKE_QDBUSXML2CPP -i ${QMAKE_FILE_OUT_BASE}.h -a :${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
dbus_adaptor_source.output_function = dbus_adaptor_source_output
dbus_adaptor_source.name = DBUSXML2CPP ADAPTOR SOURCE ${QMAKE_FILE_IN}
dbus_adaptor_source.variable_out = SOURCES
dbus_adaptor_source.input = DBUS_ADAPTOR_LIST

load(moc)
dbus_adaptor_moc.commands = $$moc_header.commands
dbus_adaptor_moc.output = $$moc_header.output
dbus_adaptor_moc.depends = $$dbus_adaptor_header.output
dbus_adaptor_moc.input = DBUS_ADAPTOR_HEADERS
dbus_adaptor_moc.variable_out = GENERATED_SOURCES
dbus_adaptor_moc.name = $$moc_header.name

defineReplace(dbus_adaptor_source_output) {
    return("$$lower($$section($$list($$basename(1)),.,-2,-2))_adaptor.cpp")
}

QMAKE_EXTRA_COMPILERS += dbus_adaptor_header dbus_adaptor_source dbus_adaptor_moc