2012-12-11 21:08:15 +00:00
|
|
|
#
|
|
|
|
# W A R N I N G
|
|
|
|
# -------------
|
|
|
|
#
|
|
|
|
# This file is not part of the Qt API. It exists purely as an
|
|
|
|
# implementation detail. It may change from version to version
|
|
|
|
# without notice, or even be removed.
|
|
|
|
#
|
|
|
|
# We mean it.
|
|
|
|
#
|
|
|
|
|
2012-08-02 17:15:45 +00:00
|
|
|
load(moc)
|
|
|
|
qtPrepareTool(QMAKE_QDBUSXML2CPP, qdbusxml2cpp)
|
|
|
|
|
|
|
|
defineReplace(qdbusOutputBasename) {
|
|
|
|
return($$lower($$section($$list($$basename(1)),.,-2,-2)))
|
|
|
|
}
|
|
|
|
|
|
|
|
dbus_TYPE = $$upper($$dbus_type)
|
|
|
|
|
2012-08-02 19:37:18 +00:00
|
|
|
groups =
|
|
|
|
for(entry, DBUS_$${dbus_TYPE}S) {
|
2012-08-02 17:15:45 +00:00
|
|
|
|
2012-08-02 19:37:18 +00:00
|
|
|
files = $$eval($${entry}.files)
|
|
|
|
isEmpty(files) {
|
|
|
|
files = $$entry
|
|
|
|
group = dbus_$${dbus_type}
|
|
|
|
} else {
|
|
|
|
group = $${entry}_dbus_$${dbus_type}
|
2012-08-02 17:15:45 +00:00
|
|
|
}
|
2012-08-02 19:37:18 +00:00
|
|
|
groups *= $$group
|
2012-08-02 17:15:45 +00:00
|
|
|
|
2012-08-02 19:37:18 +00:00
|
|
|
input_list = $$upper($$group)_LIST
|
|
|
|
for(subent, $$list($$unique(files))) {
|
|
|
|
|
|
|
|
!contains(subent, .*\\w\\.xml$) {
|
|
|
|
warning("Invalid D-BUS $${dbus_type}: '$$subent', please use 'com.mydomain.myinterface.xml' instead.")
|
|
|
|
next()
|
|
|
|
}
|
|
|
|
|
|
|
|
$$input_list += $$subent
|
|
|
|
}
|
2012-08-02 17:15:45 +00:00
|
|
|
}
|
|
|
|
|
2012-08-02 19:37:18 +00:00
|
|
|
for(group, groups) {
|
|
|
|
GROUP = $$upper($$group)
|
|
|
|
input_list = $${GROUP}_LIST
|
|
|
|
|
|
|
|
# qmake does not keep empty elements in lists, so we reverse-engineer the short name
|
|
|
|
grp = $$replace(group, _?dbus_$${dbus_type}\$, )
|
|
|
|
isEmpty(grp) {
|
2012-08-02 19:31:36 +00:00
|
|
|
hdr_flags = $$eval(QDBUSXML2CPP_$${dbus_TYPE}_HEADER_FLAGS)
|
|
|
|
src_flags = $$eval(QDBUSXML2CPP_$${dbus_TYPE}_SOURCE_FLAGS)
|
2012-08-02 19:37:18 +00:00
|
|
|
} else {
|
|
|
|
hdr_flags = $$eval($${grp}.header_flags)
|
|
|
|
src_flags = $$eval($${grp}.source_flags)
|
|
|
|
}
|
2012-08-02 19:31:36 +00:00
|
|
|
|
2012-09-13 18:42:44 +00:00
|
|
|
$${group}_header.commands = $$QMAKE_QDBUSXML2CPP $$hdr_flags $$qdbusxml2cpp_option ${QMAKE_FILE_OUT}: ${QMAKE_FILE_IN}
|
|
|
|
$${group}_header.output = ${QMAKE_FUNC_FILE_IN_qdbusOutputBasename}_$${dbus_type}.h
|
|
|
|
$${group}_header.name = DBUSXML2CPP $${dbus_TYPE} HEADER ${QMAKE_FILE_IN}
|
|
|
|
$${group}_header.variable_out = $${GROUP}_HEADERS
|
|
|
|
$${group}_header.input = $$input_list
|
2012-08-02 17:15:45 +00:00
|
|
|
|
2012-09-13 18:42:44 +00:00
|
|
|
$${group}_source.commands = $$QMAKE_QDBUSXML2CPP -i ${QMAKE_FILE_OUT_BASE}.h $$src_flags $$qdbusxml2cpp_option :${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
|
|
|
|
$${group}_source.output = ${QMAKE_FUNC_FILE_IN_qdbusOutputBasename}_$${dbus_type}.cpp
|
|
|
|
$${group}_source.name = DBUSXML2CPP $${dbus_TYPE} SOURCE ${QMAKE_FILE_IN}
|
|
|
|
$${group}_source.variable_out = SOURCES
|
|
|
|
$${group}_source.input = $$input_list
|
2012-08-02 17:15:45 +00:00
|
|
|
|
2012-09-13 18:42:44 +00:00
|
|
|
$${group}_moc.commands = $$moc_header.commands
|
|
|
|
$${group}_moc.output = $$moc_header.output
|
|
|
|
$${group}_moc.input = $${GROUP}_HEADERS
|
|
|
|
$${group}_moc.variable_out = GENERATED_SOURCES
|
2013-08-14 22:18:55 +00:00
|
|
|
$${group}_moc.name = $${GROUP}_$$moc_header.name
|
2012-08-02 17:15:45 +00:00
|
|
|
|
|
|
|
QMAKE_EXTRA_COMPILERS += $${group}_header $${group}_source $${group}_moc
|
2012-08-02 19:37:18 +00:00
|
|
|
}
|