[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-buildsystem
Subject: [PATCH] Add optional arguments to QT4_GENERATE_DBUS_INTERFACE
From: Thomas McGuire <thomas.mcguire () gmx ! net>
Date: 2007-12-19 19:37:26
Message-ID: 200712192037.26225.thomas.mcguire () gmx ! net
[Download RAW message or body]
Hi,
the current QT4_GENERATE_DBUS_INTERFACE does not allow me to only extract
methods marked with Q_SCRIPTABLE. I need this for KMail, I don't want to
export each public slot.
The attached patch simply uses an optional parameter to specify the parameters
for qdbuscpp2xml. For example, by passing -psm to the macro, only scriptable
methodes are exported.
Is the patch OK? Any comments? Can I commit?
Regards,
Thomas
["dbus.diff" (text/x-diff)]
Index: FindQt4.cmake
===================================================================
--- FindQt4.cmake (revision 749270)
+++ FindQt4.cmake (working copy)
@@ -57,11 +57,16 @@
# If <classname> is provided, then it will be used as the classname of the
# adaptor itself.
#
-# macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] )
+# macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] [qdbuscpp2xmlFlags] )
# generate the xml interface file from the given header.
# If the optional argument interfacename is omitted, the name of the
# interface file is constructed from the basename of the header with
# the suffix .xml appended.
+# With the optional parameter qdbuscpp2xmlFlags, you can add custom
+# parameters to the qdbuscpp2xml, which does the actual interface extraction.
+# This parameter is useful if you want to extract only methods marked with
+# Q_SCRIPTABLE.
+# See qdbuscpp2xml --help and \
http://techbase.kde.org/Development/Tutorials/D-Bus/Creating_Interfaces#qdbuscpp2xml \
# # QT_FOUND If false, don't try to use Qt.
# QT4_FOUND If false, don't try to use Qt 4.
@@ -1077,28 +1082,29 @@
SET_SOURCE_FILES_PROPERTIES(<files> PROPERTIES NO_NAMESPACE TRUE)
QT4_ADD_DBUS_INTERFACES(<srcList> <files>)\n")
ENDMACRO(QT4_ADD_DBUS_INTERFACES_NO_NAMESPACE)
-
- MACRO(QT4_GENERATE_DBUS_INTERFACE _header) # _customName )
+
+ MACRO(QT4_GENERATE_DBUS_INTERFACE _header) # _customName ) # _qdbuscpp2xmlFlags )
SET(_customName "${ARGV1}")
+ SET(_qdbuscpp2xmlFlags ${ARGV2})
GET_FILENAME_COMPONENT(_in_file ${_header} ABSOLUTE)
GET_FILENAME_COMPONENT(_basename ${_header} NAME_WE)
-
+
IF (_customName)
SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName})
ELSE (_customName)
SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml)
ENDIF (_customName)
-
+
ADD_CUSTOM_COMMAND(OUTPUT ${_target}
- COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${_in_file} > ${_target}
+ COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${_qdbuscpp2xmlFlags} ${_in_file} > \
${_target} DEPENDS ${_in_file}
)
ENDMACRO(QT4_GENERATE_DBUS_INTERFACE)
-
-
+
+
MACRO(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # \
_optionalBasename _optionalClassName) GET_FILENAME_COMPONENT(_infile ${_xml_file} \
ABSOLUTE)
-
+
SET(_optionalBasename "${ARGV4}")
IF (_optionalBasename)
SET(_basename ${_optionalBasename} )
_______________________________________________
Kde-buildsystem mailing list
Kde-buildsystem@kde.org
https://mail.kde.org/mailman/listinfo/kde-buildsystem
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic