Boost::MQTT5 and boost 1.82.0?

Boost.MQTT5 is a header-only library. To use Boost.MQTT5 it requires
Hi Boost, i read here [1] that boost::mqtt5 needs boost 1.82.0 but it is published with 1.88.0 Beta1 How to use boost::mqtt5 with boost 1.82.0? the following:
C++17 capable compiler Boost 1.82 or later. In addition to Asio, we use other header- only libraries. OpenSSL. If you require an SSL connection by using
boost::asio::ssl::stream. [1] https://www.boost.org/doc/libs/1_88_0_beta1/libs/mqtt5/doc/html/mqtt5/intro....

On Tue, Mar 25, 2025 at 10:25 AM Georg Gast via Boost <boost@lists.boost.org> wrote:
Hi Boost,
i read here [1] that boost::mqtt5 needs boost 1.82.0 but it is published with 1.88.0 Beta1
How to use boost::mqtt5 with boost 1.82.0?
Looking at their CMakeLists.txt file here: mqtt5/CMakeLists.txt at develop · boostorg/mqtt5 <https://github.com/boostorg/mqtt5/blob/develop/CMakeLists.txt> It seems like the easiest thing to do is just clone it into the Boost tree and treat it like any other library from there. Unless I'm misreading, it doesn't seem like this library is meant to be installed by CMake on its own. It only has two modes: I'm a boost.mqtt developer or I'm going to install this via BoostRoot.cmake. Haven't tested it locally but if you clone it into a 1.82 tree, you should be able to: cmake -DBOOST_INCLUDE_LIBRARIES=mqtt5 -DCMAKE_INSTALL_PREFIX=_install .. && cmake --build . --target install -j20 - Christian

Am Dienstag, dem 25.03.2025 um 12:55 -0700 schrieb Christian Mazakas via Boost:
On Tue, Mar 25, 2025 at 10:25 AM Georg Gast via Boost <[boost@lists.boost.org](mailto:boost@lists.boost.org)> wrote:
Hi Boost,
i read here [1] that boost::mqtt5 needs boost 1.82.0 but it is published with 1.88.0 Beta1
How to use boost::mqtt5 with boost 1.82.0?
Looking at their CMakeLists.txt file here: mqtt5/CMakeLists.txt at develop · boostorg/mqtt5
It seems like the easiest thing to do is just clone it into the Boost
tree
and treat it like any other library from there. Unless I'm misreading, it doesn't seem like this library is meant to be installed by CMake on its own. It only has two modes: I'm a boost.mqtt developer or I'm going to install this via BoostRoot.cmake.
Haven't tested it locally but if you clone it into a 1.82 tree, you should be able to:
cmake -DBOOST_INCLUDE_LIBRARIES=mqtt5 - DCMAKE_INSTALL_PREFIX=_install .. && cmake --build . --target install -j20
- Christian
A short information: I tried to add that sobmodule to my project but the CMakeLists.txt from it didn`t work. My CMake didn`t find Boost::asio. I added the following library to my project with normal boost at 1.82.0 # This library can be removed if we are on Boost 1.88 or newer add_library(Boost::mqtt5 INTERFACE IMPORTED GLOBAL) find_package(Boost ${BOOST_VERSION} COMPONENTS system REQUIRED) set_target_properties( Boost::mqtt5 PROPERTIES IMPORTED_GLOBAL TRUE ) target_include_directories (Boost::mqtt5 INTERFACE upstream/include) target_link_libraries (Boost::mqtt5 INTERFACE Boost::system) Apart from this, i could easily migrate my small project to Boost::mqtt5 and boost 1.82.0 Thanks! - Georg
participants (2)
-
Christian Mazakas
-
Georg Gast