This is an old revision of the document!
Table of Contents
mosquitto-clients
to be able to build anything on MacOS, install Command Line Tools for Xcode using the following command: xcode-select –install
To successfully build mosquitto-clients we first need to install dependencies:
cmake
To successfully build mosquitto, cmake is required. To install cmake, follow along these instructions: https://cmake.org/install/.
First time install: ./bootstrap make make install
Updating cmake:
cmake .
make
make install
mosquitto-clients
git clone –single-branch -b master https://github.com/eclipse/mosquitto.git
cd ./mosquitto
Build options
- c-ares (libc-ares-dev on Debian based systems) - disable with
make WITH_SRV=no - libuuid (uuid-dev) - disable with
make WITH_UUID=no - libwebsockets (libwebsockets-dev) - enable with
make WITH_WEBSOCKETS=yes - openssl (libssl-dev on Debian based systems) - disable with
make WITH_TLS=no
Build with SSL
When building with SSL: export OPENSSL_ROOT_DIR=“$HOME_BREW/Cellar/openssl/1.0.2n” export OPENSSL_INCLUDE_DIR=“$HOME_BREW/Cellar/openssl/1.0.2n/include”
Generate makefiles
cmake .
make & install libmosquitto
cd ./lib
make
sudo make install
make & install mosquitto clients
cd ../client
make
sudo make install
In case you screwed up, clean directory git clean -f -d git reset –hard
Alternatively: Build without SSL
cmake -DWITH_TLS_PSK=OFF -DWITH_TLS=OFF .
Surpress Policy CMP0042 Warning
Add -DCMAKE_MACOSX_RPATH=ON to cmake command
