emqx / qmqtt

MQTT client for Qt
https://www.emqx.com
Other
698 stars 337 forks source link

Add *.pri file for projects that don't need/want to use QMQTT as an external library #224

Closed alex-spataru closed 3 years ago

alex-spataru commented 3 years ago

Hi,

First of all, thanks for this project! I am currently using it in Serial Studio for uploading incoming serial/network data to an MQTT broker, which in turns allows the application to display data from any Serial Studio instance connected to the MQTT broker.

To integrate it in Serial Studio, I made some modifications that allow me to "skip" the library linking process and integrate QMQTT directly with my codebase as a submodule. Please let me know if these modifications are ok for you.

Greetings!

Edit: you can see an example qmake code for integrating QMQTT with the *.pri file here. The QT_BUILD_QMQTT_SRC definition is used in qmqtt_global.h to avoid adding export/import symbols to the headers.

mwallnoefer commented 3 years ago

The change does not seem to be invasive so we could accept it, remembering to maintain also the *.pri file.

@ejvr Are you okay with this change? Could it break some existing tests you are aware of?

ejvr commented 3 years ago

Just left 2 review comments. I think the change is a good idea, but I'd like to have those 2 minor adjustments

alex-spataru commented 3 years ago

Just left 2 review comments. I think the change is a good idea, but I'd like to have those 2 minor adjustments.

Thanks a lot, I'll do the required modifications & post an update on this thread when they are ready.

alex-spataru commented 3 years ago

I just updated both files, please let me know if the comments that I added in qmqtt.pri are clear enough. I am not a native english speaker 😄