]>
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 | |
72784cf7 AM |
23 | @@ -365,22 +365,6 @@ |
24 | webserver/server.cpp | |
25 | webserver/Websockets.cpp | |
26 | webserver/WebsocketHandler.cpp | |
9dda6696 AM |
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 | ) | |
9dda6696 | 44 | |
72784cf7 AM |
45 | add_executable(domoticz ${domoticz_SRCS}) |
46 | @@ -682,6 +666,47 @@ | |
9ee4483e | 47 | ENDIF(LIBUSB_FOUND) |
9a71e0cb | 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 | + | |
4b7cd6b2 JP |
91 | IF(EXISTS /sys/class/gpio OR FORCE_WITH_GPIO) |
92 | message(STATUS "GPIO is available") | |
93 | add_definitions(-DWITH_GPIO) | |
72784cf7 AM |
94 | --- a/hardware/plugins/Plugins.cpp 2020-03-22 09:16:16.000000000 -0500 |
95 | +++ b/hardware/plugins/Plugins.cpp 2020-03-24 13:45:46.056965796 -0500 | |
96 | @@ -16,10 +16,11 @@ | |
4ff80f89 | 97 | #include "../../main/Logger.h" |
72784cf7 AM |
98 | #include "../../main/SQLHelper.h" |
99 | #include "../../main/mainworker.h" | |
72784cf7 AM |
100 | -#include "../../tinyxpath/tinyxml.h" |
101 | ||
102 | #include "../../notifications/NotificationHelper.h" | |
103 | ||
104 | +#include <tinyxml.h> | |
105 | + | |
cd9dc7ee JP |
106 | #define ADD_STRING_TO_DICT(pPlugin, pDict, key, value) \ |
107 | { \ | |
fbf2e314 | 108 | PyNewRef pStr(value); \ |
72784cf7 AM |
109 | --- a/hardware/AnnaThermostat.cpp 2020-03-22 09:16:16.000000000 -0500 |
110 | +++ b/hardware/AnnaThermostat.cpp 2020-03-24 10:41:00.530030798 -0500 | |
111 | @@ -9,7 +9,7 @@ | |
112 | #include "../httpclient/HTTPClient.h" | |
113 | #include "../main/mainworker.h" | |
114 | ||
115 | -#include "../tinyxpath/tinyxml.h" | |
116 | +#include <tinyxml.h> | |
117 | ||
118 | #define round(a) ( int ) ( a + .5 ) | |
119 | ||
120 | --- a/hardware/EcoDevices.cpp 2020-03-22 09:16:16.000000000 -0500 | |
121 | +++ b/hardware/EcoDevices.cpp 2020-03-24 10:47:20.095926641 -0500 | |
122 | @@ -33,11 +33,11 @@ | |
4ff80f89 | 123 | #include "../main/Logger.h" |
72784cf7 | 124 | #include "hardwaretypes.h" |
72784cf7 AM |
125 | #include "../httpclient/HTTPClient.h" |
126 | -#include "../tinyxpath/tinyxml.h" | |
127 | -#include "../tinyxpath/xpath_static.h" | |
128 | #include "../webserver/Base64.h" | |
129 | #include "../main/json_helper.h" | |
130 | #include <sstream> | |
131 | +#include <tinyxml.h> | |
132 | +#include <xpath_static.h> | |
133 | ||
fbf2e314 JP |
134 | // Minimum EcoDevises firmware required |
135 | #define MAJOR 1 | |
9ee4483e AM |
136 | --- a/hardware/OnkyoAVTCP.cpp 2018-06-23 09:18:06.000000000 -0500 |
137 | +++ b/hardware/OnkyoAVTCP.cpp 2018-07-08 14:21:06.884163094 -0500 | |
4ff80f89 | 138 | @@ -3,14 +3,14 @@ |
9ee4483e AM |
139 | #include "../main/Logger.h" |
140 | #include "../main/Helper.h" | |
9dda6696 | 141 | #include "../main/SQLHelper.h" |
9ee4483e | 142 | -#include <iostream> |
9dda6696 | 143 | #include "../main/mainworker.h" |
9ee4483e | 144 | #include "../hardware/hardwaretypes.h" |
72784cf7 | 145 | -#include <json/json.h> |
9dda6696 | 146 | -#include "../tinyxpath/tinyxml.h" |
9ee4483e | 147 | #include "../main/WebServer.h" |
9dda6696 | 148 | |
9ee4483e AM |
149 | +#include <iostream> |
150 | #include <sstream> | |
72784cf7 | 151 | +#include <json/json.h> |
9dda6696 | 152 | +#include <tinyxml.h> |
9dda6696 | 153 | |
9ee4483e | 154 | #define RETRY_DELAY 30 |
9dda6696 | 155 | |
72784cf7 AM |
156 | --- a/hardware/RAVEn.cpp 2020-03-22 09:16:16.000000000 -0500 |
157 | +++ b/hardware/RAVEn.cpp 2020-03-24 12:55:59.616310732 -0500 | |
158 | @@ -5,8 +5,8 @@ | |
159 | #include "../main/Logger.h" | |
160 | #include "../main/mainworker.h" | |
161 | #include "../main/RFXtrx.h" | |
162 | -#include "../tinyxpath/tinyxml.h" | |
163 | #include "hardwaretypes.h" | |
164 | +#include <tinyxml.h> | |
165 | ||
166 | //Rainforest RAVEn USB ZigBee Smart Meter Adapter | |
167 | //https://rainforestautomation.com/rfa-z106-raven/ | |
195b28da JP |
168 | --- domoticz-2023.1/hardware/EnphaseAPI.cpp.orig 2023-02-14 14:48:00.000000000 +0100 |
169 | +++ domoticz-2023.1/hardware/EnphaseAPI.cpp 2023-02-15 19:45:27.206931016 +0100 | |
170 | @@ -10,7 +10,7 @@ | |
171 | #include "../main/RFXtrx.h" | |
172 | #include "../main/SQLHelper.h" | |
173 | #include "../notifications/NotificationHelper.h" | |
174 | -#include "../tinyxpath/tinyxml.h" | |
175 | +#include <tinyxml.h> | |
4ff80f89 JP |
176 | #include "../webserver/Base64.h" |
177 | #include "hardwaretypes.h" | |
178 | #include <iostream> | |
179 | --- domoticz-2023.2/hardware/Enever.cpp.orig 2023-07-21 17:23:44.000000000 +0200 | |
180 | +++ domoticz-2023.2/hardware/Enever.cpp 2023-07-21 20:39:42.240298598 +0200 | |
181 | @@ -9,7 +9,7 @@ | |
182 | #include "../main/RFXtrx.h" | |
183 | #include "../main/SQLHelper.h" | |
184 | #include "../notifications/NotificationHelper.h" | |
185 | -#include "../tinyxpath/tinyxml.h" | |
186 | +#include <tinyxml.h> | |
187 | #include "../webserver/Base64.h" | |
195b28da JP |
188 | #include "hardwaretypes.h" |
189 | #include <iostream> |