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, 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
Clone master-branch from Github: git clone –single-branch -b master https://github.com/eclipse/mosquitto.git Change directory into mosquitto: cd ./mosquitto
When building with SSL: export OPENSSL_ROOT_DIR=“$HOME_BREW/Cellar/openssl/1.x.x” export OPENSSL_INCLUDE_DIR=“$OPENSSL_ROOT_DIR/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 and repeat git clean -f -d git reset –hard
To build without SSL-support add option -DWITH_TLS=OFF. This inherits -DWITH_TLS_PSK=OFF.
make WITH_SRV=nomake WITH_UUID=nomake WITH_WEBSOCKETS=yesmake WITH_TLS=noAdd -DCMAKE_MACOSX_RPATH=ON to cmake command
If you build with -WITH_SRV=OFF this is not needed.
Download latest archive from https://c-ares.haxx.se ./configure make sudo make install