Skip to content

QMake includes for using Paho MQTT C/C++ Client Libraries as directly built-in

License

Notifications You must be signed in to change notification settings

inobelar/Builtin-QMake-Paho-MQTT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Built-in QMake Paho MQTT

The set of QMake include files for using Eclipse Paho C Client Library (v1.3.1) and Eclipse Paho MQTT C++ Client Library (v1.1) as directly built-in into executable.

This is useful in cases when dynamic/static linking is not possible for some reasons.

Integration

Paho MQTT C Library

Add into your *.pro file next lines:

PAHO_MQTT_C_SRC_PATH = <path/to>/paho.mqtt.c/src/
include(<path/to>/paho_mqtt_c_builtin/paho_mqtt_c_builtin.pri)

Paho MQTT C++ Library

Notice, that C++ library depends on C library, and requires async support:

Add into your *.pro file next lines:

PAHO_MQTT_C_SRC_PATH = <path/to>/paho.mqtt.c/src/
CONFIG += PAHO_MQTT_C_ASYNC
include(<path/to>/paho_mqtt_c_builtin/paho_mqtt_c_builtin.pri)

PAHO_MQTT_CPP_SRC_PATH = <path/to>/paho.mqtt.cpp/src/
include(<path/to>/paho_mqtt_cpp_builtin/paho_mqtt_cpp_builtin.pri)

Example of usage

  1. Prepare dependencies
cd your_project_dir

# Clone Eclipse Paho MQTT C and C++ libraries into third_party/ directory
mkdir third_party
cd third_party
git clone https://github.com/eclipse/paho.mqtt.c.git
git clone https://github.com/eclipse/paho.mqtt.cpp.git
cd ..

# Clone this repository
git clone https://github.com/inobelar/Builtin-QMake-Paho-MQTT.git
  1. In *.pro file add:
PAHO_MQTT_C_SRC_PATH = $$PWD/third_party/paho.mqtt.c/src/
CONFIG += PAHO_MQTT_C_ASYNC
include($$PWD/Builtin-QMake-Paho-MQTT/paho_mqtt_c_builtin/paho_mqtt_c_builtin.pri)

PAHO_MQTT_CPP_SRC_PATH = $$PWD/third_party/paho.mqtt.cpp/src/
include($$PWD/Builtin-QMake-Paho-MQTT/paho_mqtt_cpp_builtin/paho_mqtt_cpp_builtin.pri)
  1. Try to compile C examples or C++ examples

About

QMake includes for using Paho MQTT C/C++ Client Libraries as directly built-in

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published