diff --git a/CMakeLists.txt b/CMakeLists.txt index b0e3850..a158e66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,15 +4,14 @@ project(thrawn) set(CMAKE_CXX_STANDARD 17) set(CMAKE_EXPORT_COMPILE_COMMANDS true) -include_directories("/usr/local/include") -include_directories("/usr/local/include/mqttpp-0.1") -link_directories("/usr/local/lib/mqttpp-0.1") - +include_directories("lib/mqtt++/include") find_package(spdlog CONFIG REQUIRED) +find_package(OpenSSL REQUIRED) include(FindLua) find_package(lua REQUIRED) +find_package(eclipse-paho-mqtt-c CONFIG REQUIRED) -add_executable(thrawn src/main.cpp src src/thrawn_api.cpp src/Service.cpp src/Cache.cpp src/LuaEngine.cpp) -target_link_libraries(thrawn ${LIBS} spdlog::spdlog ${LUA_LIBRARIES} mqttpp) +add_executable(thrawn src/main.cpp src src/thrawn_api.cpp src/Service.cpp src/Cache.cpp src/LuaEngine.cpp lib/mqtt++/src/mqtt++.cpp) +target_link_libraries(thrawn ${LIBS} spdlog::spdlog ${LUA_LIBRARIES} OpenSSL::SSL eclipse-paho-mqtt-c::paho-mqtt3cs-static) target_include_directories(thrawn PRIVATE ${LUA_INCLUDE_DIR}) install(TARGETS thrawn DESTINATION bin) \ No newline at end of file diff --git a/lib/mqtt++ b/lib/mqtt++ index 84824b4..a7b570a 160000 --- a/lib/mqtt++ +++ b/lib/mqtt++ @@ -1 +1 @@ -Subproject commit 84824b468fc39174026863b59fa75de113715b47 +Subproject commit a7b570ab18dbc685b8e17242239746bc436c3f55 diff --git a/src/main.cpp b/src/main.cpp index 0812bd1..f474bfa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,7 +3,6 @@ #include #include "Service.h" #include "thrawn_api.h" -#include "mqttpp.h" #include "spdlog/spdlog.h" #include "Cache.h" #include "LuaEngine.h" @@ -11,6 +10,7 @@ #include "Version.h" #include #include +#include "mqtt++.h" std::vector lua_scripts_in_folder(const std::string& path_str) { std::vector scripts; @@ -35,6 +35,7 @@ int main(int argc, char* argv[]) { std::string mqttServerURI = "tcp://chimaera:1883"; mqttpp::LastWill last_will {"dev/thrawn/status", "0"}; std::string version_topic = "dev/thrawn/version"; + std::string version_topic_value = std::to_string(THRAWN_MAJOR_VERSION) + "." + std::to_string(THRAWN_MINOR_VERSION) + "." + std::to_string(THRAWN_PATCH_VERSION); std::string lastWillConnected = "1";