#22 Add common tde_setup_dbus macro

Merged
SlavekB merged 1 commits from feat/add-test-dbus into master 2 months ago
SlavekB commented 2 months ago

The macro is primarily used for modules that create some D-Bus services.

It can be called without a parameter – only dbus-1 will be tested and the paths to the dbus files will be searched. Alternatively, the name of the TQt dbus module – usually dbus-1-tqt – can be entered as a parameter. If the parameter is entered, the TQt dbus module will also be tested.

Note: Macro in this form can also be used for the R14.0.x branch.

The macro is primarily used for modules that create some D-Bus services. It can be called without a parameter – only dbus-1 will be tested and the paths to the dbus files will be searched. Alternatively, the name of the TQt dbus module – usually dbus-1-tqt – can be entered as a parameter. If the parameter is entered, the TQt dbus module will also be tested. Note: Macro in this form can also be used for the R14.0.x branch.
SlavekB added the
PR/rfc
label 2 months ago
MicheleC approved these changes 2 months ago
Great work, just need to fix the two points I mentioned
modules/TDEMacros.cmake
@@ -1814,0 +1875,4 @@
1875
+
1876
+  if( NOT "${ARGV}" STREQUAL "" AND NOT DBUS_TQT_FOUND )
1877
+    pkg_search_module( DBUS_TQT ${ARGV} )
1878
+    if( NOT DBUS_FOUND )
MicheleC

Should be:

if( NOT DBUS_TQT_FOUND )
Should be: ``` if( NOT DBUS_TQT_FOUND ) ```
SlavekB

The macro is ready to allow two ways to call:

  1. without argument:

    tde_setup_dbus( )
    
  2. with argument:

    tde_setup_dbus( dbus-1-tqt )
    

Therefore, there is a condition if the argument was or was not entered.

The macro is ready to allow two ways to call: 1. without argument: ``` tde_setup_dbus( ) ``` 2. with argument: ``` tde_setup_dbus( dbus-1-tqt ) ``` Therefore, there is a condition if the argument was or was not entered.
SlavekB

Now I understand - the mistake fixed.

Now I understand - the mistake fixed.
modules/TDEMacros.cmake
@@ -1814,0 +1878,4 @@
1878
+    if( NOT DBUS_FOUND )
1879
+      tde_message_fatal( "${ARGV} is required, but not found on your system" )
1880
+    endif( )
1881
+    if( "${ARGV}" STREQUAL "dbus-1-tqt" )
MicheleC

Only check if dbus-1-tqt was found

if( DBUS_TQT_FOUND AND "${ARGV}" STREQUAL "dbus-1-tqt" )
Only check if dbus-1-tqt was found ``` if( DBUS_TQT_FOUND AND "${ARGV}" STREQUAL "dbus-1-tqt" ) ```
SlavekB

Here are two independent conditions. If an argument was entered, but the requested module was not found then here is tde_message_fatal.

A separate condition is if the required module was dbus-1-tqt, then the path to the binary will be searched.

Therefore, it seems to me appropriate not to mix these conditions into one.

Here are two independent conditions. If an argument was entered, but the requested module was not found then here is `tde_message_fatal`. A separate condition is if the required module was dbus-1-tqt, then the path to the binary will be searched. Therefore, it seems to me appropriate not to mix these conditions into one.
MicheleC approved these changes 2 months ago
LGTM :+1:
SlavekB removed the
PR/rfc
label 2 months ago
MicheleC commented 2 months ago
Owner

Related to issue #20

Related to issue #20
MicheleC added this to the R14.0.6 release milestone 2 months ago
SlavekB deleted branch feat/add-test-dbus 2 months ago

Reviewers

MicheleC approved these changes 2 months ago
The pull request has been merged.
Sign in to join this conversation.
Loading…
Cancel
Save
There is no content yet.