From 694241f7905967bf69af3a31265180c00b73e28c Mon Sep 17 00:00:00 2001 From: Michael Cronenworth Date: Fri, 11 Aug 2017 10:08:27 -0500 Subject: [PATCH] build: Detect and allow external tinyxpath library usage Signed-off-by: Michael Cronenworth --- CMakeLists.txt | 57 +++++++++++++++++++++--------- removed from Fedora patch hardware/AnnaThermostat.cpp | 3 +- removed from Fedora patch hardware/RAVEn.cpp | 3 +- removed from Fedora patch hardware/openzwave/control_panel/ozwcp.cpp | 3 +- removed from Fedora patch hardware/plugins/PluginManager.cpp | 3 +- removed from Fedora patch hardware/plugins/Plugins.cpp | 3 +- removed from Fedora patch main/LuaCommon.cpp | 7 +++- removed from Fedora patch main/LuaHandler.cpp | 3 +- removed from Fedora patch msbuild/domoticz.vcxproj | 6 ++-- 9 files changed, 62 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc231d8f6..334f203a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -512,22 +512,6 @@ json/json_reader.cpp json/json_value.cpp json/json_writer.cpp -tinyxpath/action_store.cpp -tinyxpath/htmlutil.cpp -tinyxpath/lex_util.cpp -tinyxpath/node_set.cpp -tinyxpath/tinystr.cpp -tinyxpath/tinyxml.cpp -tinyxpath/tinyxmlerror.cpp -tinyxpath/tinyxmlparser.cpp -tinyxpath/tokenlist.cpp -tinyxpath/xml_util.cpp -tinyxpath/xpath_expression.cpp -tinyxpath/xpath_processor.cpp -tinyxpath/xpath_stream.cpp -tinyxpath/xpath_stack.cpp -tinyxpath/xpath_static.cpp -tinyxpath/xpath_syntax.cpp ) add_executable(domoticz ${domoticz_SRCS}) @@ -658,6 +642,47 @@ ENDIF(LIBUSB_FOUND) endif(WITH_LIBUSB) +option(USE_BUILTIN_TINYXPATH "Use builtin tinyxpath library" YES) +IF(USE_BUILTIN_TINYXPATH) + include_directories(tinyxpath) + target_sources( + domoticz + PUBLIC + tinyxpath/action_store.cpp + tinyxpath/htmlutil.cpp + tinyxpath/lex_util.cpp + tinyxpath/node_set.cpp + tinyxpath/tinystr.cpp + tinyxpath/tinyxml.cpp + tinyxpath/tinyxmlerror.cpp + tinyxpath/tinyxmlparser.cpp + tinyxpath/tokenlist.cpp + tinyxpath/xml_util.cpp + tinyxpath/xpath_expression.cpp + tinyxpath/xpath_processor.cpp + tinyxpath/xpath_stream.cpp + tinyxpath/xpath_stack.cpp + tinyxpath/xpath_static.cpp + tinyxpath/xpath_syntax.cpp + ) +else() + pkg_check_modules(TinyXML QUIET tinyxml) + IF(TinyXML_FOUND) + MESSAGE(STATUS "TinyXML found at: ${TinyXML_LIBRARIES}") + IF(EXISTS "/usr/include/tinyxpath/xpath_processor.h") + MESSAGE(STATUS "TinyXPath found") + target_link_libraries(domoticz ${TinyXML_LIBRARIES}) + target_link_libraries(domoticz tinyxpath) + include_directories(/usr/include/tinyxpath) + add_definitions(-DWITH_EXTERNAL_TINYXPATH) + else() + MESSAGE(FATAL_ERROR "TinyXPath not found but USE_BUILTIN_TINYXPATH=NO") + ENDIF() + else() + MESSAGE(FATAL_ERROR "TinyXML not found but USE_BUILTIN_TINYXPATH=NO") + ENDIF(TinyXML_FOUND) +ENDIF(USE_BUILTIN_TINYXPATH) + ## support lua popen on Linux platforms #IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") # SET(OperatingSystem "Linux") --- a/hardware/OnkyoAVTCP.cpp 2018-06-23 09:18:06.000000000 -0500 +++ b/hardware/OnkyoAVTCP.cpp 2018-07-08 14:21:06.884163094 -0500 @@ -3,16 +3,16 @@ #include "../main/Logger.h" #include "../main/Helper.h" #include "../main/SQLHelper.h" -#include #include "../main/localtime_r.h" #include "../main/mainworker.h" #include "../hardware/hardwaretypes.h" #include "../json/json.h" -#include "../tinyxpath/tinyxml.h" #include "../main/WebServer.h" +#include #include #include +#include #define RETRY_DELAY 30