]>
Commit | Line | Data |
---|---|---|
9dda6696 AM |
1 | From 694241f7905967bf69af3a31265180c00b73e28c Mon Sep 17 00:00:00 2001 |
2 | From: Michael Cronenworth <mike@cchtml.com> | |
3 | Date: Fri, 11 Aug 2017 10:08:27 -0500 | |
4 | Subject: [PATCH] build: Detect and allow external tinyxpath library usage | |
5 | ||
6 | Signed-off-by: Michael Cronenworth <mike@cchtml.com> | |
7 | --- | |
8 | CMakeLists.txt | 57 +++++++++++++++++++++--------- | |
9ee4483e AM |
9 | removed from Fedora patch hardware/AnnaThermostat.cpp | 3 +- |
10 | removed from Fedora patch hardware/RAVEn.cpp | 3 +- | |
11 | removed from Fedora patch hardware/openzwave/control_panel/ozwcp.cpp | 3 +- | |
12 | removed from Fedora patch hardware/plugins/PluginManager.cpp | 3 +- | |
13 | removed from Fedora patch hardware/plugins/Plugins.cpp | 3 +- | |
14 | removed from Fedora patch main/LuaCommon.cpp | 7 +++- | |
15 | removed from Fedora patch main/LuaHandler.cpp | 3 +- | |
9dda6696 AM |
16 | removed from Fedora patch msbuild/domoticz.vcxproj | 6 ++-- |
17 | 9 files changed, 62 insertions(+), 26 deletions(-) | |
18 | ||
19 | diff --git a/CMakeLists.txt b/CMakeLists.txt | |
20 | index bc231d8f6..334f203a6 100644 | |
21 | --- a/CMakeLists.txt | |
22 | +++ b/CMakeLists.txt | |
9ee4483e | 23 | @@ -512,22 +512,6 @@ |
9dda6696 AM |
24 | json/json_reader.cpp |
25 | json/json_value.cpp | |
26 | json/json_writer.cpp | |
27 | -tinyxpath/action_store.cpp | |
28 | -tinyxpath/htmlutil.cpp | |
29 | -tinyxpath/lex_util.cpp | |
30 | -tinyxpath/node_set.cpp | |
31 | -tinyxpath/tinystr.cpp | |
32 | -tinyxpath/tinyxml.cpp | |
33 | -tinyxpath/tinyxmlerror.cpp | |
34 | -tinyxpath/tinyxmlparser.cpp | |
35 | -tinyxpath/tokenlist.cpp | |
36 | -tinyxpath/xml_util.cpp | |
37 | -tinyxpath/xpath_expression.cpp | |
38 | -tinyxpath/xpath_processor.cpp | |
39 | -tinyxpath/xpath_stream.cpp | |
40 | -tinyxpath/xpath_stack.cpp | |
41 | -tinyxpath/xpath_static.cpp | |
42 | -tinyxpath/xpath_syntax.cpp | |
43 | ) | |
44 | add_executable(domoticz ${domoticz_SRCS}) | |
45 | ||
9ee4483e AM |
46 | @@ -658,6 +642,47 @@ |
47 | ENDIF(LIBUSB_FOUND) | |
48 | endif(WITH_LIBUSB) | |
9dda6696 AM |
49 | |
50 | +option(USE_BUILTIN_TINYXPATH "Use builtin tinyxpath library" YES) | |
51 | +IF(USE_BUILTIN_TINYXPATH) | |
52 | + include_directories(tinyxpath) | |
53 | + target_sources( | |
54 | + domoticz | |
55 | + PUBLIC | |
56 | + tinyxpath/action_store.cpp | |
57 | + tinyxpath/htmlutil.cpp | |
58 | + tinyxpath/lex_util.cpp | |
59 | + tinyxpath/node_set.cpp | |
60 | + tinyxpath/tinystr.cpp | |
61 | + tinyxpath/tinyxml.cpp | |
62 | + tinyxpath/tinyxmlerror.cpp | |
63 | + tinyxpath/tinyxmlparser.cpp | |
64 | + tinyxpath/tokenlist.cpp | |
65 | + tinyxpath/xml_util.cpp | |
66 | + tinyxpath/xpath_expression.cpp | |
67 | + tinyxpath/xpath_processor.cpp | |
68 | + tinyxpath/xpath_stream.cpp | |
69 | + tinyxpath/xpath_stack.cpp | |
70 | + tinyxpath/xpath_static.cpp | |
71 | + tinyxpath/xpath_syntax.cpp | |
72 | + ) | |
73 | +else() | |
74 | + pkg_check_modules(TinyXML QUIET tinyxml) | |
75 | + IF(TinyXML_FOUND) | |
76 | + MESSAGE(STATUS "TinyXML found at: ${TinyXML_LIBRARIES}") | |
77 | + IF(EXISTS "/usr/include/tinyxpath/xpath_processor.h") | |
78 | + MESSAGE(STATUS "TinyXPath found") | |
79 | + target_link_libraries(domoticz ${TinyXML_LIBRARIES}) | |
80 | + target_link_libraries(domoticz tinyxpath) | |
81 | + include_directories(/usr/include/tinyxpath) | |
82 | + add_definitions(-DWITH_EXTERNAL_TINYXPATH) | |
83 | + else() | |
84 | + MESSAGE(FATAL_ERROR "TinyXPath not found but USE_BUILTIN_TINYXPATH=NO") | |
85 | + ENDIF() | |
86 | + else() | |
87 | + MESSAGE(FATAL_ERROR "TinyXML not found but USE_BUILTIN_TINYXPATH=NO") | |
88 | + ENDIF(TinyXML_FOUND) | |
89 | +ENDIF(USE_BUILTIN_TINYXPATH) | |
90 | + | |
9ee4483e AM |
91 | ## support lua popen on Linux platforms |
92 | #IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") | |
93 | # SET(OperatingSystem "Linux") | |
94 | --- a/hardware/OnkyoAVTCP.cpp 2018-06-23 09:18:06.000000000 -0500 | |
95 | +++ b/hardware/OnkyoAVTCP.cpp 2018-07-08 14:21:06.884163094 -0500 | |
96 | @@ -3,16 +3,16 @@ | |
97 | #include "../main/Logger.h" | |
98 | #include "../main/Helper.h" | |
9dda6696 | 99 | #include "../main/SQLHelper.h" |
9ee4483e | 100 | -#include <iostream> |
9dda6696 AM |
101 | #include "../main/localtime_r.h" |
102 | #include "../main/mainworker.h" | |
9ee4483e | 103 | #include "../hardware/hardwaretypes.h" |
9dda6696 AM |
104 | #include "../json/json.h" |
105 | -#include "../tinyxpath/tinyxml.h" | |
9ee4483e | 106 | #include "../main/WebServer.h" |
9dda6696 | 107 | |
9ee4483e AM |
108 | +#include <iostream> |
109 | #include <sstream> | |
110 | #include <map> | |
9dda6696 | 111 | +#include <tinyxml.h> |
9dda6696 | 112 | |
9ee4483e | 113 | #define RETRY_DELAY 30 |
9dda6696 | 114 |