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
6 Signed-off-by: Michael Cronenworth <mike@cchtml.com>
8 CMakeLists.txt | 57 +++++++++++++++++++++---------
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 +-
16 removed from Fedora patch msbuild/domoticz.vcxproj | 6 ++--
17 9 files changed, 62 insertions(+), 26 deletions(-)
19 diff --git a/CMakeLists.txt b/CMakeLists.txt
20 index bc231d8f6..334f203a6 100644
25 webserver/Websockets.cpp
26 webserver/WebsocketHandler.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
45 add_executable(domoticz ${domoticz_SRCS})
50 +option(USE_BUILTIN_TINYXPATH "Use builtin tinyxpath library" YES)
51 +IF(USE_BUILTIN_TINYXPATH)
52 + include_directories(tinyxpath)
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
74 + pkg_check_modules(TinyXML QUIET tinyxml)
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)
84 + MESSAGE(FATAL_ERROR "TinyXPath not found but USE_BUILTIN_TINYXPATH=NO")
87 + MESSAGE(FATAL_ERROR "TinyXML not found but USE_BUILTIN_TINYXPATH=NO")
88 + ENDIF(TinyXML_FOUND)
89 +ENDIF(USE_BUILTIN_TINYXPATH)
93 # try to find open-zwave, if found, include support
94 --- a/hardware/openzwave/control_panel/ozwcp.cpp 2020-03-22 09:16:16.000000000 -0500
95 +++ b/hardware/openzwave/control_panel/ozwcp.cpp 2020-03-24 10:53:04.968630391 -0500
100 -#include "../../../tinyxpath/tinyxml.h"
101 +#include <tinyxml.h>
103 //#include "microhttpd.h"
105 --- a/hardware/plugins/PluginManager.cpp 2020-03-22 09:16:16.000000000 -0500
106 +++ b/hardware/plugins/PluginManager.cpp 2020-03-24 13:53:05.305852598 -0500
108 #include "../../main/Logger.h"
109 #include "../../main/SQLHelper.h"
110 #include "../../main/WebServer.h"
111 -#include "../../tinyxpath/tinyxml.h"
113 +# include "../../tinyxpath/tinyxml.h"
116 # include <sys/stat.h>
117 +# include <tinyxml.h>
120 #include "DelayedLink.h"
121 --- a/hardware/plugins/Plugins.cpp 2020-03-22 09:16:16.000000000 -0500
122 +++ b/hardware/plugins/Plugins.cpp 2020-03-24 13:45:46.056965796 -0500
124 #include "../../main/SQLHelper.h"
125 #include "../../main/mainworker.h"
126 #include "../../main/localtime_r.h"
127 -#include "../../tinyxpath/tinyxml.h"
129 #include "../../notifications/NotificationHelper.h"
131 +#include <tinyxml.h>
133 #define ADD_STRING_TO_DICT(pPlugin, pDict, key, value) \
135 PyNewRef pStr(value); \
136 --- a/hardware/AnnaThermostat.cpp 2020-03-22 09:16:16.000000000 -0500
137 +++ b/hardware/AnnaThermostat.cpp 2020-03-24 10:41:00.530030798 -0500
139 #include "../httpclient/HTTPClient.h"
140 #include "../main/mainworker.h"
142 -#include "../tinyxpath/tinyxml.h"
143 +#include <tinyxml.h>
145 #define round(a) ( int ) ( a + .5 )
147 --- a/hardware/EcoDevices.cpp 2020-03-22 09:16:16.000000000 -0500
148 +++ b/hardware/EcoDevices.cpp 2020-03-24 10:47:20.095926641 -0500
150 #include "hardwaretypes.h"
151 #include "../main/localtime_r.h"
152 #include "../httpclient/HTTPClient.h"
153 -#include "../tinyxpath/tinyxml.h"
154 -#include "../tinyxpath/xpath_static.h"
155 #include "../webserver/Base64.h"
156 #include "../main/json_helper.h"
158 +#include <tinyxml.h>
159 +#include <xpath_static.h>
161 // Minimum EcoDevises firmware required
163 --- a/hardware/OnkyoAVTCP.cpp 2018-06-23 09:18:06.000000000 -0500
164 +++ b/hardware/OnkyoAVTCP.cpp 2018-07-08 14:21:06.884163094 -0500
166 #include "../main/Logger.h"
167 #include "../main/Helper.h"
168 #include "../main/SQLHelper.h"
170 #include "../main/localtime_r.h"
171 #include "../main/mainworker.h"
172 #include "../hardware/hardwaretypes.h"
173 -#include <json/json.h>
174 -#include "../tinyxpath/tinyxml.h"
175 #include "../main/WebServer.h"
179 +#include <json/json.h>
180 +#include <tinyxml.h>
182 #define RETRY_DELAY 30
184 --- a/hardware/RAVEn.cpp 2020-03-22 09:16:16.000000000 -0500
185 +++ b/hardware/RAVEn.cpp 2020-03-24 12:55:59.616310732 -0500
187 #include "../main/Logger.h"
188 #include "../main/mainworker.h"
189 #include "../main/RFXtrx.h"
190 -#include "../tinyxpath/tinyxml.h"
191 #include "hardwaretypes.h"
192 +#include <tinyxml.h>
194 //Rainforest RAVEn USB ZigBee Smart Meter Adapter
195 //https://rainforestautomation.com/rfa-z106-raven/