diff --git a/CMakeLists.txt b/CMakeLists.txt index a142abd..2e78aa7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,17 +23,10 @@ include(FetchContent) set(BOOST_INCLUDE_LIBRARIES asio assert core endian json mqtt5 fusion optional random range smart_ptr spirit type_traits) set(BOOST_ENABLE_CMAKE ON) -set(BOOST_NO_SYSTEM_PATHS TRUE) set(Boost_NO_SYSTEM_PATHS ON) +set(BOOST_ROOT /usr/local/boost-1.89) -include(FetchContent) -FetchContent_Declare( - Boost - GIT_REPOSITORY https://github.com/boostorg/boost.git - GIT_TAG boost-1.89.0 - GIT_SHALLOW TRUE -) - +find_package(Boost 1.89 REQUIRED COMPONENTS json mqtt5) # spdlog set(SPDLOG_USE_STD_FORMAT ON) FetchContent_Declare( @@ -50,7 +43,7 @@ FetchContent_Declare(fmt URL https://github.com/fmtlib/fmt/archive/refs/tags/10.2.1.zip URL_MD5 1bba4e8bdd7b0fa98f207559ffa380a3 ) -FetchContent_MakeAvailable(fmt spdlog Boost) +FetchContent_MakeAvailable(fmt spdlog) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) # add_compile_definitions(BOOST_ASIO_ENABLE_HANDLER_TRACKING) diff --git a/libs/mqtt_client.cpp b/libs/mqtt_client.cpp index 28d8c89..f434c67 100644 --- a/libs/mqtt_client.cpp +++ b/libs/mqtt_client.cpp @@ -21,10 +21,7 @@ #include #include #include -#include -#include #include -#include #include // Adapter to use std::pmr::memory_resource with boost::json