From kde-buildsystem Wed Dec 19 19:37:26 2007 From: Thomas McGuire Date: Wed, 19 Dec 2007 19:37:26 +0000 To: kde-buildsystem Subject: [PATCH] Add optional arguments to QT4_GENERATE_DBUS_INTERFACE Message-Id: <200712192037.26225.thomas.mcguire () gmx ! net> X-MARC-Message: https://marc.info/?l=kde-buildsystem&m=119809329319938 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_2LXaHC9IbrWC5pm" --Boundary-00=_2LXaHC9IbrWC5pm Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 --Boundary-00=_2LXaHC9IbrWC5pm Content-Type: text/x-diff; charset="us-ascii"; name="dbus.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dbus.diff" Index: FindQt4.cmake =================================================================== --- FindQt4.cmake (revision 749270) +++ FindQt4.cmake (working copy) @@ -57,11 +57,16 @@ # If 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( PROPERTIES NO_NAMESPACE TRUE) QT4_ADD_DBUS_INTERFACES( )\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} ) --Boundary-00=_2LXaHC9IbrWC5pm Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem --Boundary-00=_2LXaHC9IbrWC5pm--