We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
ixwebsocket: add 10.2.5 + several improvements
Specify library name and version:  **ixwebsocket/10.2.5**

- [x] I've read the [guidelines](https://github.com/conan-io/conan-center-index/blob/master/docs/how_to_add_packages.md) for contributing.
- [x] I've followed the [PEP8](https://www.python.org/dev/peps/pep-0008/) style guides for Python code in the recipes.
- [x] I've used the [latest](https://github.com/conan-io/conan/releases/latest) Conan client version.
- [x] I've tried at least one configuration locally with the
      [conan-center hook](https://github.com/conan-io/hooks.git) activated.

Others modifications:
- use transparent cmake integration in test_package
- optional zlib for version >= 10.1.5
- don't force PIC for version >= 9.5.7
- add public definitions in cpp_info
- fix system libs on Windows
poco: fix hooks
Specify library name and version:  **poco/all**

- [x] I've read the [guidelines](https://github.com/conan-io/conan-center-index/blob/master/docs/how_to_add_packages.md) for contributing.
- [x] I've followed the [PEP8](https://www.python.org/dev/peps/pep-0008/) style guides for Python code in the recipes.
- [x] I've used the [latest](https://github.com/conan-io/conan/releases/latest) Conan client version.
- [x] I've tried at least one configuration locally with the
      [conan-center hook](https://github.com/conan-io/hooks.git) activated.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `recipes/poco/all/conanfile.py`
Content:
```
1 from conans import ConanFile, CMake, tools
2 from conans.errors import ConanException, ConanInvalidConfiguration
3 from collections import namedtuple, OrderedDict
4 import os
5 
6 
7 class PocoConan(ConanFile):
8     name = "poco"
9     url = "https://github.com/conan-io/conan-center-index"
10     homepage = "https://pocoproject.org"
11     topics = ("conan", "poco", "building", "networking", "server", "mobile", "embedded")
12     exports_sources = "CMakeLists.txt", "patches/**"
13     generators = "cmake", "cmake_find_package"
14     settings = "os", "arch", "compiler", "build_type"
15     license = "BSL-1.0"
16     description = "Modern, powerful open source C++ class libraries for building network- and internet-based " \
17                   "applications that run on desktop, server, mobile and embedded systems."
18     options = {
19         "shared": [True, False],
20         "fPIC": [True, False],
21     }
22     default_options = {
23         "shared": False,
24         "fPIC": True,
25     }
26 
27     _PocoComponent = namedtuple("_PocoComponent", ("option", "default_option", "dependencies", "is_lib"))
28     _poco_component_tree = {
29         "mod_poco": _PocoComponent("enable_apacheconnector", False, ("PocoUtil", "PocoNet", ), False),  # also external apr and apr-util
30         "PocoCppParser": _PocoComponent("enable_cppparser", False, ("PocoFoundation", ), False),
31         # "PocoCppUnit": _PocoComponent("enable_cppunit", False, ("PocoFoundation", ), False)),
32         "PocoCrypto": _PocoComponent("enable_crypto", True, ("PocoFoundation", ), True),    # also external openssl
33         "PocoData": _PocoComponent("enable_data", True, ("PocoFoundation", ), True),
34         "PocoDataMySQL": _PocoComponent("enable_data_mysql", False, ("PocoData", ), True),
35         "PocoDataODBC": _PocoComponent("enable_data_odbc", False, ("PocoData", ), True),
36         "PocoDataPostgreSQL": _PocoComponent("enable_data_postgresql", False, ("PocoData", ), True),    # also external postgresql
37         "PocoDataSQLite": _PocoComponent("enable_data_sqlite", True, ("PocoData", ), True),  # also external sqlite3
38         "PocoEncodings": _PocoComponent("enable_encodings", True, ("PocoFoundation", ), True),
39         # "PocoEncodingsCompiler": _PocoComponent("enable_encodingscompiler", False, ("PocoNet", "PocoUtil", ), False),
40         "PocoFoundation": _PocoComponent(None, "PocoFoundation", (), True),
41         "PocoJSON": _PocoComponent("enable_json", True, ("PocoFoundation", ), True),
42         "PocoJWT": _PocoComponent("enable_jwt", True, ("PocoJSON", "PocoCrypto", ), True),
43         "PocoMongoDB": _PocoComponent("enable_mongodb", True, ("PocoNet", ), True),
44         "PocoNet": _PocoComponent("enable_net", True, ("PocoFoundation", ), True),
45         "PocoNetSSL": _PocoComponent("enable_netssl", True, ("PocoCrypto", "PocoUtil", "PocoNet", ), True),    # also external openssl
46         "PocoNetSSLWin": _PocoComponent("enable_netssl_win", True, ("PocoNet", "PocoUtil", ), True),
47         "PocoPDF": _PocoComponent("enable_pdf", False, ("PocoXML", "PocoUtil", ), True),
48         "PocoPageCompiler": _PocoComponent("enable_pagecompiler", False, ("PocoNet", "PocoUtil", ), False),
49         "PocoFile2Page": _PocoComponent("enable_pagecompiler_file2page", False, ("PocoNet", "PocoUtil", "PocoXML", "PocoJSON", ), False),
50         "PocoPocoDoc": _PocoComponent("enable_pocodoc", False, ("PocoUtil", "PocoXML", "PocoCppParser", ), False),
51         "PocoRedis": _PocoComponent("enable_redis", True, ("PocoNet", ), True),
52         "PocoSevenZip": _PocoComponent("enable_sevenzip", False, ("PocoUtil", "PocoXML", ), True),
53         "PocoUtil": _PocoComponent("enable_util", True, ("PocoFoundation", "PocoXML", "PocoJSON", ), True),
54         "PocoXML": _PocoComponent("enable_xml", True, ("PocoFoundation", ), True),
55         "PocoZip": _PocoComponent("enable_zip", True, ("PocoUtil", "PocoXML", ), True),
56     }
57     
58     for comp in _poco_component_tree.values():
59         if comp.option:
60             options[comp.option] = [True, False]
61             default_options[comp.option] = comp.default_option
62     del comp
63 
64     @property
65     def _poco_ordered_components(self):
66         remaining_components = dict((compname, set(compopts.dependencies)) for compname, compopts in self._poco_component_tree.items())
67         ordered_components = []
68         while remaining_components:
69             components_no_deps = set(compname for compname, compopts in remaining_components.items() if not compopts)
70             if not components_no_deps:
71                 raise ConanException("The poco dependency tree is invalid and contains a cycle")
72             for c in components_no_deps:
73                 remaining_components.pop(c)
74             ordered_components.extend(components_no_deps)
75             for rname in remaining_components.keys():
76                 remaining_components[rname] = remaining_components[rname].difference(components_no_deps)
77         ordered_components.reverse()
78         return ordered_components
79 
80     _cmake = None
81 
82     @property
83     def _source_subfolder(self):
84         return "source_subfolder"
85 
86     @property
87     def _build_subfolder(self):
88         return "build_subfolder"
89 
90     def source(self):
91         tools.get(**self.conan_data["sources"][self.version])
92         extracted_folder = "poco-poco-{}-release".format(self.version)
93         os.rename(extracted_folder, self._source_subfolder)
94 
95     def config_options(self):
96         if self.settings.os == "Windows":
97             del self.options.fPIC
98         else:
99             del self.options.enable_netssl_win
100         if tools.Version(self.version) < "1.9":
101             del self.options.enable_encodings
102         if tools.Version(self.version) < "1.10":
103             del self.options.enable_data_postgresql
104             del self.options.enable_jwt
105 
106     def configure(self):
107         if self.options.enable_apacheconnector:
108             raise ConanInvalidConfiguration("Apache connector not supported: https://github.com/pocoproject/poco/issues/1764")
109         if self.options.enable_data_mysql:
110             raise ConanInvalidConfiguration("MySQL not supported yet, open an issue here please: %s" % self.url)
111         if self.options.get_safe("enable_data_postgresql", False):
112             raise ConanInvalidConfiguration("PostgreSQL not supported yet, open an issue here please: %s" % self.url)
113         for compopt in self._poco_component_tree.values():
114             if not compopt.option:
115                 continue
116             if self.options.get_safe(compopt.option, False):
117                 for compdep in compopt.dependencies:
118                     if not self._poco_component_tree[compdep].option:
119                         continue
120                     if not self.options.get_safe(self._poco_component_tree[compdep].option, False):
121                         raise ConanInvalidConfiguration("option {} requires also option {}".format(compopt.option, self._poco_component_tree[compdep].option))
122 
123     def requirements(self):
124         self.requires("pcre/8.41")
125         self.requires("zlib/1.2.11")
126         if self.options.enable_xml:
127             self.requires("expat/2.2.9")
128         if self.options.enable_data_sqlite:
129             self.requires("sqlite3/3.31.1")
130         if self.options.enable_apacheconnector:
131             self.requires("apr/1.7.0")
132             self.requires("apr-util/1.6.1")
133             raise ConanInvalidConfiguration("apache2 is not (yet) available on CCI")
134             self.requires("apache2/x.y.z")
135         if self.options.enable_netssl or \
136                 self.options.enable_crypto or \
137                 self.options.get_safe("enable_jwt", False):
138             self.requires("openssl/1.1.1g")
139 
140     def _patch_sources(self):
141         for patch in self.conan_data.get("patches", {}).get(self.version, []):
142             tools.patch(**patch)
143 
144     def _configure_cmake(self):
145         if self._cmake:
146             return self._cmake
147         self._cmake = CMake(self)
148         if tools.Version(self.version) < "1.10.1":
149             self._cmake.definitions["POCO_STATIC"] = not self.options.shared
150         for comp in self._poco_component_tree.values():
151             if not comp.option:
152                 continue
153             self._cmake.definitions[comp.option.upper()] = self.options.get_safe(comp.option, False)
154         self._cmake.definitions["POCO_UNBUNDLED"] = True
155         self._cmake.definitions["CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP"] = True
156         if self.settings.os == "Windows" and self.settings.compiler == "Visual Studio":  # MT or MTd
157             self._cmake.definitions["POCO_MT"] = "ON" if "MT" in str(self.settings.compiler.runtime) else "OFF"
158         self.output.info(self._cmake.definitions)
159         # On Windows, Poco needs a message (MC) compiler.
160         with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op():
161             self._cmake.configure(build_dir=self._build_subfolder)
162         return self._cmake
163 
164     def build(self):
165         if self.options.enable_data_sqlite:
166             if self.options["sqlite3"].threadsafe == 0:
167                 raise ConanInvalidConfiguration("sqlite3 must be built with threadsafe enabled")
168         self._patch_sources()
169         cmake = self._configure_cmake()
170         cmake.build()
171 
172     def package(self):
173         self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
174         cmake = self._configure_cmake()
175         cmake.install()
176         tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
177         tools.rmdir(os.path.join(self.package_folder, "cmake"))
178 
179     @property
180     def _ordered_libs(self):
181         libs = []
182         for compname in self._poco_ordered_components:
183             comp_options = self._poco_component_tree[compname]
184             if comp_options.is_lib:
185                 if not comp_options.option:
186                     libs.append(compname)
187                 elif self.options.get_safe(comp_options.option, False):
188                     libs.append(compname)
189         return libs
190 
191     def package_info(self):
192         suffix = str(self.settings.compiler.runtime).lower()  \
193                  if self.settings.compiler == "Visual Studio" and not self.options.shared \
194                  else ("d" if self.settings.build_type == "Debug" else "")
195 
196         self.cpp_info.libs = list("{}{}".format(lib, suffix) for lib in self._ordered_libs)
197         
198         if self.settings.os == "Linux":
199             self.cpp_info.system_libs.extend(["pthread", "dl", "rt"])
200 
201         if self.settings.compiler == "Visual Studio":
202             self.cpp_info.defines.append("POCO_NO_AUTOMATIC_LIBS")
203         if not self.options.shared:
204             self.cpp_info.defines.append("POCO_STATIC=ON")
205             if self.settings.compiler == "Visual Studio":
206                 self.cpp_info.system_libs.extend(["ws2_32", "iphlpapi", "crypt32"])
207         self.cpp_info.names["cmake_find_package"] = "Poco"
208         self.cpp_info.names["cmake_find_package_multi"] = "Poco"
209
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/recipes/poco/all/conanfile.py b/recipes/poco/all/conanfile.py
--- a/recipes/poco/all/conanfile.py
+++ b/recipes/poco/all/conanfile.py
@@ -54,7 +54,7 @@
         "PocoXML": _PocoComponent("enable_xml", True, ("PocoFoundation", ), True),
         "PocoZip": _PocoComponent("enable_zip", True, ("PocoUtil", "PocoXML", ), True),
     }
-    
+
     for comp in _poco_component_tree.values():
         if comp.option:
             options[comp.option] = [True, False]
@@ -108,6 +108,9 @@
             raise ConanInvalidConfiguration("Apache connector not supported: https://github.com/pocoproject/poco/issues/1764")
         if self.options.enable_data_mysql:
             raise ConanInvalidConfiguration("MySQL not supported yet, open an issue here please: %s" % self.url)
+        if self.settings.compiler == "Visual Studio":
+            if self.options.shared and "MT" in str(self.settings.compiler.runtime):
+                raise ConanInvalidConfiguration("Cannot build shared poco libraries with MT(d) runtime")
         if self.options.get_safe("enable_data_postgresql", False):
             raise ConanInvalidConfiguration("PostgreSQL not supported yet, open an issue here please: %s" % self.url)
         for compopt in self._poco_component_tree.values():
@@ -124,18 +127,18 @@
         self.requires("pcre/8.41")
         self.requires("zlib/1.2.11")
         if self.options.enable_xml:
-            self.requires("expat/2.2.9")
+            self.requires("expat/2.2.10")
         if self.options.enable_data_sqlite:
-            self.requires("sqlite3/3.31.1")
+            self.requires("sqlite3/3.33.0")
         if self.options.enable_apacheconnector:
             self.requires("apr/1.7.0")
             self.requires("apr-util/1.6.1")
+            # FIXME: missing apache2 recipe
             raise ConanInvalidConfiguration("apache2 is not (yet) available on CCI")
-            self.requires("apache2/x.y.z")
         if self.options.enable_netssl or \
                 self.options.enable_crypto or \
                 self.options.get_safe("enable_jwt", False):
-            self.requires("openssl/1.1.1g")
+            self.requires("openssl/1.1.1h")
 
     def _patch_sources(self):
         for patch in self.conan_data.get("patches", {}).get(self.version, []):
@@ -194,7 +197,7 @@
                  else ("d" if self.settings.build_type == "Debug" else "")
 
         self.cpp_info.libs = list("{}{}".format(lib, suffix) for lib in self._ordered_libs)
-        
+
         if self.settings.os == "Linux":
             self.cpp_info.system_libs.extend(["pthread", "dl", "rt"])
 
@@ -202,7 +205,7 @@
             self.cpp_info.defines.append("POCO_NO_AUTOMATIC_LIBS")
         if not self.options.shared:
             self.cpp_info.defines.append("POCO_STATIC=ON")
-            if self.settings.compiler == "Visual Studio":
+            if self.settings.os == "Windows":
                 self.cpp_info.system_libs.extend(["ws2_32", "iphlpapi", "crypt32"])
         self.cpp_info.names["cmake_find_package"] = "Poco"
         self.cpp_info.names["cmake_find_package_multi"] = "Poco"

{"golden_diff": "diff --git a/recipes/poco/all/conanfile.py b/recipes/poco/all/conanfile.py\n--- a/recipes/poco/all/conanfile.py\n+++ b/recipes/poco/all/conanfile.py\n@@ -54,7 +54,7 @@\n         \"PocoXML\": _PocoComponent(\"enable_xml\", True, (\"PocoFoundation\", ), True),\n         \"PocoZip\": _PocoComponent(\"enable_zip\", True, (\"PocoUtil\", \"PocoXML\", ), True),\n     }\n-    \n+\n     for comp in _poco_component_tree.values():\n         if comp.option:\n             options[comp.option] = [True, False]\n@@ -108,6 +108,9 @@\n             raise ConanInvalidConfiguration(\"Apache connector not supported: https://github.com/pocoproject/poco/issues/1764\")\n         if self.options.enable_data_mysql:\n             raise ConanInvalidConfiguration(\"MySQL not supported yet, open an issue here please: %s\" % self.url)\n+        if self.settings.compiler == \"Visual Studio\":\n+            if self.options.shared and \"MT\" in str(self.settings.compiler.runtime):\n+                raise ConanInvalidConfiguration(\"Cannot build shared poco libraries with MT(d) runtime\")\n         if self.options.get_safe(\"enable_data_postgresql\", False):\n             raise ConanInvalidConfiguration(\"PostgreSQL not supported yet, open an issue here please: %s\" % self.url)\n         for compopt in self._poco_component_tree.values():\n@@ -124,18 +127,18 @@\n         self.requires(\"pcre/8.41\")\n         self.requires(\"zlib/1.2.11\")\n         if self.options.enable_xml:\n-            self.requires(\"expat/2.2.9\")\n+            self.requires(\"expat/2.2.10\")\n         if self.options.enable_data_sqlite:\n-            self.requires(\"sqlite3/3.31.1\")\n+            self.requires(\"sqlite3/3.33.0\")\n         if self.options.enable_apacheconnector:\n             self.requires(\"apr/1.7.0\")\n             self.requires(\"apr-util/1.6.1\")\n+            # FIXME: missing apache2 recipe\n             raise ConanInvalidConfiguration(\"apache2 is not (yet) available on CCI\")\n-            self.requires(\"apache2/x.y.z\")\n         if self.options.enable_netssl or \\\n                 self.options.enable_crypto or \\\n                 self.options.get_safe(\"enable_jwt\", False):\n-            self.requires(\"openssl/1.1.1g\")\n+            self.requires(\"openssl/1.1.1h\")\n \n     def _patch_sources(self):\n         for patch in self.conan_data.get(\"patches\", {}).get(self.version, []):\n@@ -194,7 +197,7 @@\n                  else (\"d\" if self.settings.build_type == \"Debug\" else \"\")\n \n         self.cpp_info.libs = list(\"{}{}\".format(lib, suffix) for lib in self._ordered_libs)\n-        \n+\n         if self.settings.os == \"Linux\":\n             self.cpp_info.system_libs.extend([\"pthread\", \"dl\", \"rt\"])\n \n@@ -202,7 +205,7 @@\n             self.cpp_info.defines.append(\"POCO_NO_AUTOMATIC_LIBS\")\n         if not self.options.shared:\n             self.cpp_info.defines.append(\"POCO_STATIC=ON\")\n-            if self.settings.compiler == \"Visual Studio\":\n+            if self.settings.os == \"Windows\":\n                 self.cpp_info.system_libs.extend([\"ws2_32\", \"iphlpapi\", \"crypt32\"])\n         self.cpp_info.names[\"cmake_find_package\"] = \"Poco\"\n         self.cpp_info.names[\"cmake_find_package_multi\"] = \"Poco\"\n", "issue": "ixwebsocket: add 10.2.5 + several improvements\nSpecify library name and version:  **ixwebsocket/10.2.5**\r\n\r\n- [x] I've read the [guidelines](https://github.com/conan-io/conan-center-index/blob/master/docs/how_to_add_packages.md) for contributing.\r\n- [x] I've followed the [PEP8](https://www.python.org/dev/peps/pep-0008/) style guides for Python code in the recipes.\r\n- [x] I've used the [latest](https://github.com/conan-io/conan/releases/latest) Conan client version.\r\n- [x] I've tried at least one configuration locally with the\r\n      [conan-center hook](https://github.com/conan-io/hooks.git) activated.\r\n\r\nOthers modifications:\r\n- use transparent cmake integration in test_package\r\n- optional zlib for version >= 10.1.5\r\n- don't force PIC for version >= 9.5.7\r\n- add public definitions in cpp_info\r\n- fix system libs on Windows\npoco: fix hooks\nSpecify library name and version:  **poco/all**\r\n\r\n- [x] I've read the [guidelines](https://github.com/conan-io/conan-center-index/blob/master/docs/how_to_add_packages.md) for contributing.\r\n- [x] I've followed the [PEP8](https://www.python.org/dev/peps/pep-0008/) style guides for Python code in the recipes.\r\n- [x] I've used the [latest](https://github.com/conan-io/conan/releases/latest) Conan client version.\r\n- [x] I've tried at least one configuration locally with the\r\n      [conan-center hook](https://github.com/conan-io/hooks.git) activated.\r\n\n", "before_files": [{"content": "from conans import ConanFile, CMake, tools\nfrom conans.errors import ConanException, ConanInvalidConfiguration\nfrom collections import namedtuple, OrderedDict\nimport os\n\n\nclass PocoConan(ConanFile):\n    name = \"poco\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://pocoproject.org\"\n    topics = (\"conan\", \"poco\", \"building\", \"networking\", \"server\", \"mobile\", \"embedded\")\n    exports_sources = \"CMakeLists.txt\", \"patches/**\"\n    generators = \"cmake\", \"cmake_find_package\"\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    license = \"BSL-1.0\"\n    description = \"Modern, powerful open source C++ class libraries for building network- and internet-based \" \\\n                  \"applications that run on desktop, server, mobile and embedded systems.\"\n    options = {\n        \"shared\": [True, False],\n        \"fPIC\": [True, False],\n    }\n    default_options = {\n        \"shared\": False,\n        \"fPIC\": True,\n    }\n\n    _PocoComponent = namedtuple(\"_PocoComponent\", (\"option\", \"default_option\", \"dependencies\", \"is_lib\"))\n    _poco_component_tree = {\n        \"mod_poco\": _PocoComponent(\"enable_apacheconnector\", False, (\"PocoUtil\", \"PocoNet\", ), False),  # also external apr and apr-util\n        \"PocoCppParser\": _PocoComponent(\"enable_cppparser\", False, (\"PocoFoundation\", ), False),\n        # \"PocoCppUnit\": _PocoComponent(\"enable_cppunit\", False, (\"PocoFoundation\", ), False)),\n        \"PocoCrypto\": _PocoComponent(\"enable_crypto\", True, (\"PocoFoundation\", ), True),    # also external openssl\n        \"PocoData\": _PocoComponent(\"enable_data\", True, (\"PocoFoundation\", ), True),\n        \"PocoDataMySQL\": _PocoComponent(\"enable_data_mysql\", False, (\"PocoData\", ), True),\n        \"PocoDataODBC\": _PocoComponent(\"enable_data_odbc\", False, (\"PocoData\", ), True),\n        \"PocoDataPostgreSQL\": _PocoComponent(\"enable_data_postgresql\", False, (\"PocoData\", ), True),    # also external postgresql\n        \"PocoDataSQLite\": _PocoComponent(\"enable_data_sqlite\", True, (\"PocoData\", ), True),  # also external sqlite3\n        \"PocoEncodings\": _PocoComponent(\"enable_encodings\", True, (\"PocoFoundation\", ), True),\n        # \"PocoEncodingsCompiler\": _PocoComponent(\"enable_encodingscompiler\", False, (\"PocoNet\", \"PocoUtil\", ), False),\n        \"PocoFoundation\": _PocoComponent(None, \"PocoFoundation\", (), True),\n        \"PocoJSON\": _PocoComponent(\"enable_json\", True, (\"PocoFoundation\", ), True),\n        \"PocoJWT\": _PocoComponent(\"enable_jwt\", True, (\"PocoJSON\", \"PocoCrypto\", ), True),\n        \"PocoMongoDB\": _PocoComponent(\"enable_mongodb\", True, (\"PocoNet\", ), True),\n        \"PocoNet\": _PocoComponent(\"enable_net\", True, (\"PocoFoundation\", ), True),\n        \"PocoNetSSL\": _PocoComponent(\"enable_netssl\", True, (\"PocoCrypto\", \"PocoUtil\", \"PocoNet\", ), True),    # also external openssl\n        \"PocoNetSSLWin\": _PocoComponent(\"enable_netssl_win\", True, (\"PocoNet\", \"PocoUtil\", ), True),\n        \"PocoPDF\": _PocoComponent(\"enable_pdf\", False, (\"PocoXML\", \"PocoUtil\", ), True),\n        \"PocoPageCompiler\": _PocoComponent(\"enable_pagecompiler\", False, (\"PocoNet\", \"PocoUtil\", ), False),\n        \"PocoFile2Page\": _PocoComponent(\"enable_pagecompiler_file2page\", False, (\"PocoNet\", \"PocoUtil\", \"PocoXML\", \"PocoJSON\", ), False),\n        \"PocoPocoDoc\": _PocoComponent(\"enable_pocodoc\", False, (\"PocoUtil\", \"PocoXML\", \"PocoCppParser\", ), False),\n        \"PocoRedis\": _PocoComponent(\"enable_redis\", True, (\"PocoNet\", ), True),\n        \"PocoSevenZip\": _PocoComponent(\"enable_sevenzip\", False, (\"PocoUtil\", \"PocoXML\", ), True),\n        \"PocoUtil\": _PocoComponent(\"enable_util\", True, (\"PocoFoundation\", \"PocoXML\", \"PocoJSON\", ), True),\n        \"PocoXML\": _PocoComponent(\"enable_xml\", True, (\"PocoFoundation\", ), True),\n        \"PocoZip\": _PocoComponent(\"enable_zip\", True, (\"PocoUtil\", \"PocoXML\", ), True),\n    }\n    \n    for comp in _poco_component_tree.values():\n        if comp.option:\n            options[comp.option] = [True, False]\n            default_options[comp.option] = comp.default_option\n    del comp\n\n    @property\n    def _poco_ordered_components(self):\n        remaining_components = dict((compname, set(compopts.dependencies)) for compname, compopts in self._poco_component_tree.items())\n        ordered_components = []\n        while remaining_components:\n            components_no_deps = set(compname for compname, compopts in remaining_components.items() if not compopts)\n            if not components_no_deps:\n                raise ConanException(\"The poco dependency tree is invalid and contains a cycle\")\n            for c in components_no_deps:\n                remaining_components.pop(c)\n            ordered_components.extend(components_no_deps)\n            for rname in remaining_components.keys():\n                remaining_components[rname] = remaining_components[rname].difference(components_no_deps)\n        ordered_components.reverse()\n        return ordered_components\n\n    _cmake = None\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    @property\n    def _build_subfolder(self):\n        return \"build_subfolder\"\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        extracted_folder = \"poco-poco-{}-release\".format(self.version)\n        os.rename(extracted_folder, self._source_subfolder)\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n        else:\n            del self.options.enable_netssl_win\n        if tools.Version(self.version) < \"1.9\":\n            del self.options.enable_encodings\n        if tools.Version(self.version) < \"1.10\":\n            del self.options.enable_data_postgresql\n            del self.options.enable_jwt\n\n    def configure(self):\n        if self.options.enable_apacheconnector:\n            raise ConanInvalidConfiguration(\"Apache connector not supported: https://github.com/pocoproject/poco/issues/1764\")\n        if self.options.enable_data_mysql:\n            raise ConanInvalidConfiguration(\"MySQL not supported yet, open an issue here please: %s\" % self.url)\n        if self.options.get_safe(\"enable_data_postgresql\", False):\n            raise ConanInvalidConfiguration(\"PostgreSQL not supported yet, open an issue here please: %s\" % self.url)\n        for compopt in self._poco_component_tree.values():\n            if not compopt.option:\n                continue\n            if self.options.get_safe(compopt.option, False):\n                for compdep in compopt.dependencies:\n                    if not self._poco_component_tree[compdep].option:\n                        continue\n                    if not self.options.get_safe(self._poco_component_tree[compdep].option, False):\n                        raise ConanInvalidConfiguration(\"option {} requires also option {}\".format(compopt.option, self._poco_component_tree[compdep].option))\n\n    def requirements(self):\n        self.requires(\"pcre/8.41\")\n        self.requires(\"zlib/1.2.11\")\n        if self.options.enable_xml:\n            self.requires(\"expat/2.2.9\")\n        if self.options.enable_data_sqlite:\n            self.requires(\"sqlite3/3.31.1\")\n        if self.options.enable_apacheconnector:\n            self.requires(\"apr/1.7.0\")\n            self.requires(\"apr-util/1.6.1\")\n            raise ConanInvalidConfiguration(\"apache2 is not (yet) available on CCI\")\n            self.requires(\"apache2/x.y.z\")\n        if self.options.enable_netssl or \\\n                self.options.enable_crypto or \\\n                self.options.get_safe(\"enable_jwt\", False):\n            self.requires(\"openssl/1.1.1g\")\n\n    def _patch_sources(self):\n        for patch in self.conan_data.get(\"patches\", {}).get(self.version, []):\n            tools.patch(**patch)\n\n    def _configure_cmake(self):\n        if self._cmake:\n            return self._cmake\n        self._cmake = CMake(self)\n        if tools.Version(self.version) < \"1.10.1\":\n            self._cmake.definitions[\"POCO_STATIC\"] = not self.options.shared\n        for comp in self._poco_component_tree.values():\n            if not comp.option:\n                continue\n            self._cmake.definitions[comp.option.upper()] = self.options.get_safe(comp.option, False)\n        self._cmake.definitions[\"POCO_UNBUNDLED\"] = True\n        self._cmake.definitions[\"CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP\"] = True\n        if self.settings.os == \"Windows\" and self.settings.compiler == \"Visual Studio\":  # MT or MTd\n            self._cmake.definitions[\"POCO_MT\"] = \"ON\" if \"MT\" in str(self.settings.compiler.runtime) else \"OFF\"\n        self.output.info(self._cmake.definitions)\n        # On Windows, Poco needs a message (MC) compiler.\n        with tools.vcvars(self.settings) if self.settings.compiler == \"Visual Studio\" else tools.no_op():\n            self._cmake.configure(build_dir=self._build_subfolder)\n        return self._cmake\n\n    def build(self):\n        if self.options.enable_data_sqlite:\n            if self.options[\"sqlite3\"].threadsafe == 0:\n                raise ConanInvalidConfiguration(\"sqlite3 must be built with threadsafe enabled\")\n        self._patch_sources()\n        cmake = self._configure_cmake()\n        cmake.build()\n\n    def package(self):\n        self.copy(\"LICENSE\", dst=\"licenses\", src=self._source_subfolder)\n        cmake = self._configure_cmake()\n        cmake.install()\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        tools.rmdir(os.path.join(self.package_folder, \"cmake\"))\n\n    @property\n    def _ordered_libs(self):\n        libs = []\n        for compname in self._poco_ordered_components:\n            comp_options = self._poco_component_tree[compname]\n            if comp_options.is_lib:\n                if not comp_options.option:\n                    libs.append(compname)\n                elif self.options.get_safe(comp_options.option, False):\n                    libs.append(compname)\n        return libs\n\n    def package_info(self):\n        suffix = str(self.settings.compiler.runtime).lower()  \\\n                 if self.settings.compiler == \"Visual Studio\" and not self.options.shared \\\n                 else (\"d\" if self.settings.build_type == \"Debug\" else \"\")\n\n        self.cpp_info.libs = list(\"{}{}\".format(lib, suffix) for lib in self._ordered_libs)\n        \n        if self.settings.os == \"Linux\":\n            self.cpp_info.system_libs.extend([\"pthread\", \"dl\", \"rt\"])\n\n        if self.settings.compiler == \"Visual Studio\":\n            self.cpp_info.defines.append(\"POCO_NO_AUTOMATIC_LIBS\")\n        if not self.options.shared:\n            self.cpp_info.defines.append(\"POCO_STATIC=ON\")\n            if self.settings.compiler == \"Visual Studio\":\n                self.cpp_info.system_libs.extend([\"ws2_32\", \"iphlpapi\", \"crypt32\"])\n        self.cpp_info.names[\"cmake_find_package\"] = \"Poco\"\n        self.cpp_info.names[\"cmake_find_package_multi\"] = \"Poco\"\n", "path": "recipes/poco/all/conanfile.py"}], "after_files": [{"content": "from conans import ConanFile, CMake, tools\nfrom conans.errors import ConanException, ConanInvalidConfiguration\nfrom collections import namedtuple, OrderedDict\nimport os\n\n\nclass PocoConan(ConanFile):\n    name = \"poco\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://pocoproject.org\"\n    topics = (\"conan\", \"poco\", \"building\", \"networking\", \"server\", \"mobile\", \"embedded\")\n    exports_sources = \"CMakeLists.txt\", \"patches/**\"\n    generators = \"cmake\", \"cmake_find_package\"\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    license = \"BSL-1.0\"\n    description = \"Modern, powerful open source C++ class libraries for building network- and internet-based \" \\\n                  \"applications that run on desktop, server, mobile and embedded systems.\"\n    options = {\n        \"shared\": [True, False],\n        \"fPIC\": [True, False],\n    }\n    default_options = {\n        \"shared\": False,\n        \"fPIC\": True,\n    }\n\n    _PocoComponent = namedtuple(\"_PocoComponent\", (\"option\", \"default_option\", \"dependencies\", \"is_lib\"))\n    _poco_component_tree = {\n        \"mod_poco\": _PocoComponent(\"enable_apacheconnector\", False, (\"PocoUtil\", \"PocoNet\", ), False),  # also external apr and apr-util\n        \"PocoCppParser\": _PocoComponent(\"enable_cppparser\", False, (\"PocoFoundation\", ), False),\n        # \"PocoCppUnit\": _PocoComponent(\"enable_cppunit\", False, (\"PocoFoundation\", ), False)),\n        \"PocoCrypto\": _PocoComponent(\"enable_crypto\", True, (\"PocoFoundation\", ), True),    # also external openssl\n        \"PocoData\": _PocoComponent(\"enable_data\", True, (\"PocoFoundation\", ), True),\n        \"PocoDataMySQL\": _PocoComponent(\"enable_data_mysql\", False, (\"PocoData\", ), True),\n        \"PocoDataODBC\": _PocoComponent(\"enable_data_odbc\", False, (\"PocoData\", ), True),\n        \"PocoDataPostgreSQL\": _PocoComponent(\"enable_data_postgresql\", False, (\"PocoData\", ), True),    # also external postgresql\n        \"PocoDataSQLite\": _PocoComponent(\"enable_data_sqlite\", True, (\"PocoData\", ), True),  # also external sqlite3\n        \"PocoEncodings\": _PocoComponent(\"enable_encodings\", True, (\"PocoFoundation\", ), True),\n        # \"PocoEncodingsCompiler\": _PocoComponent(\"enable_encodingscompiler\", False, (\"PocoNet\", \"PocoUtil\", ), False),\n        \"PocoFoundation\": _PocoComponent(None, \"PocoFoundation\", (), True),\n        \"PocoJSON\": _PocoComponent(\"enable_json\", True, (\"PocoFoundation\", ), True),\n        \"PocoJWT\": _PocoComponent(\"enable_jwt\", True, (\"PocoJSON\", \"PocoCrypto\", ), True),\n        \"PocoMongoDB\": _PocoComponent(\"enable_mongodb\", True, (\"PocoNet\", ), True),\n        \"PocoNet\": _PocoComponent(\"enable_net\", True, (\"PocoFoundation\", ), True),\n        \"PocoNetSSL\": _PocoComponent(\"enable_netssl\", True, (\"PocoCrypto\", \"PocoUtil\", \"PocoNet\", ), True),    # also external openssl\n        \"PocoNetSSLWin\": _PocoComponent(\"enable_netssl_win\", True, (\"PocoNet\", \"PocoUtil\", ), True),\n        \"PocoPDF\": _PocoComponent(\"enable_pdf\", False, (\"PocoXML\", \"PocoUtil\", ), True),\n        \"PocoPageCompiler\": _PocoComponent(\"enable_pagecompiler\", False, (\"PocoNet\", \"PocoUtil\", ), False),\n        \"PocoFile2Page\": _PocoComponent(\"enable_pagecompiler_file2page\", False, (\"PocoNet\", \"PocoUtil\", \"PocoXML\", \"PocoJSON\", ), False),\n        \"PocoPocoDoc\": _PocoComponent(\"enable_pocodoc\", False, (\"PocoUtil\", \"PocoXML\", \"PocoCppParser\", ), False),\n        \"PocoRedis\": _PocoComponent(\"enable_redis\", True, (\"PocoNet\", ), True),\n        \"PocoSevenZip\": _PocoComponent(\"enable_sevenzip\", False, (\"PocoUtil\", \"PocoXML\", ), True),\n        \"PocoUtil\": _PocoComponent(\"enable_util\", True, (\"PocoFoundation\", \"PocoXML\", \"PocoJSON\", ), True),\n        \"PocoXML\": _PocoComponent(\"enable_xml\", True, (\"PocoFoundation\", ), True),\n        \"PocoZip\": _PocoComponent(\"enable_zip\", True, (\"PocoUtil\", \"PocoXML\", ), True),\n    }\n\n    for comp in _poco_component_tree.values():\n        if comp.option:\n            options[comp.option] = [True, False]\n            default_options[comp.option] = comp.default_option\n    del comp\n\n    @property\n    def _poco_ordered_components(self):\n        remaining_components = dict((compname, set(compopts.dependencies)) for compname, compopts in self._poco_component_tree.items())\n        ordered_components = []\n        while remaining_components:\n            components_no_deps = set(compname for compname, compopts in remaining_components.items() if not compopts)\n            if not components_no_deps:\n                raise ConanException(\"The poco dependency tree is invalid and contains a cycle\")\n            for c in components_no_deps:\n                remaining_components.pop(c)\n            ordered_components.extend(components_no_deps)\n            for rname in remaining_components.keys():\n                remaining_components[rname] = remaining_components[rname].difference(components_no_deps)\n        ordered_components.reverse()\n        return ordered_components\n\n    _cmake = None\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    @property\n    def _build_subfolder(self):\n        return \"build_subfolder\"\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        extracted_folder = \"poco-poco-{}-release\".format(self.version)\n        os.rename(extracted_folder, self._source_subfolder)\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n        else:\n            del self.options.enable_netssl_win\n        if tools.Version(self.version) < \"1.9\":\n            del self.options.enable_encodings\n        if tools.Version(self.version) < \"1.10\":\n            del self.options.enable_data_postgresql\n            del self.options.enable_jwt\n\n    def configure(self):\n        if self.options.enable_apacheconnector:\n            raise ConanInvalidConfiguration(\"Apache connector not supported: https://github.com/pocoproject/poco/issues/1764\")\n        if self.options.enable_data_mysql:\n            raise ConanInvalidConfiguration(\"MySQL not supported yet, open an issue here please: %s\" % self.url)\n        if self.settings.compiler == \"Visual Studio\":\n            if self.options.shared and \"MT\" in str(self.settings.compiler.runtime):\n                raise ConanInvalidConfiguration(\"Cannot build shared poco libraries with MT(d) runtime\")\n        if self.options.get_safe(\"enable_data_postgresql\", False):\n            raise ConanInvalidConfiguration(\"PostgreSQL not supported yet, open an issue here please: %s\" % self.url)\n        for compopt in self._poco_component_tree.values():\n            if not compopt.option:\n                continue\n            if self.options.get_safe(compopt.option, False):\n                for compdep in compopt.dependencies:\n                    if not self._poco_component_tree[compdep].option:\n                        continue\n                    if not self.options.get_safe(self._poco_component_tree[compdep].option, False):\n                        raise ConanInvalidConfiguration(\"option {} requires also option {}\".format(compopt.option, self._poco_component_tree[compdep].option))\n\n    def requirements(self):\n        self.requires(\"pcre/8.41\")\n        self.requires(\"zlib/1.2.11\")\n        if self.options.enable_xml:\n            self.requires(\"expat/2.2.10\")\n        if self.options.enable_data_sqlite:\n            self.requires(\"sqlite3/3.33.0\")\n        if self.options.enable_apacheconnector:\n            self.requires(\"apr/1.7.0\")\n            self.requires(\"apr-util/1.6.1\")\n            # FIXME: missing apache2 recipe\n            raise ConanInvalidConfiguration(\"apache2 is not (yet) available on CCI\")\n        if self.options.enable_netssl or \\\n                self.options.enable_crypto or \\\n                self.options.get_safe(\"enable_jwt\", False):\n            self.requires(\"openssl/1.1.1h\")\n\n    def _patch_sources(self):\n        for patch in self.conan_data.get(\"patches\", {}).get(self.version, []):\n            tools.patch(**patch)\n\n    def _configure_cmake(self):\n        if self._cmake:\n            return self._cmake\n        self._cmake = CMake(self)\n        if tools.Version(self.version) < \"1.10.1\":\n            self._cmake.definitions[\"POCO_STATIC\"] = not self.options.shared\n        for comp in self._poco_component_tree.values():\n            if not comp.option:\n                continue\n            self._cmake.definitions[comp.option.upper()] = self.options.get_safe(comp.option, False)\n        self._cmake.definitions[\"POCO_UNBUNDLED\"] = True\n        self._cmake.definitions[\"CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP\"] = True\n        if self.settings.os == \"Windows\" and self.settings.compiler == \"Visual Studio\":  # MT or MTd\n            self._cmake.definitions[\"POCO_MT\"] = \"ON\" if \"MT\" in str(self.settings.compiler.runtime) else \"OFF\"\n        self.output.info(self._cmake.definitions)\n        # On Windows, Poco needs a message (MC) compiler.\n        with tools.vcvars(self.settings) if self.settings.compiler == \"Visual Studio\" else tools.no_op():\n            self._cmake.configure(build_dir=self._build_subfolder)\n        return self._cmake\n\n    def build(self):\n        if self.options.enable_data_sqlite:\n            if self.options[\"sqlite3\"].threadsafe == 0:\n                raise ConanInvalidConfiguration(\"sqlite3 must be built with threadsafe enabled\")\n        self._patch_sources()\n        cmake = self._configure_cmake()\n        cmake.build()\n\n    def package(self):\n        self.copy(\"LICENSE\", dst=\"licenses\", src=self._source_subfolder)\n        cmake = self._configure_cmake()\n        cmake.install()\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        tools.rmdir(os.path.join(self.package_folder, \"cmake\"))\n\n    @property\n    def _ordered_libs(self):\n        libs = []\n        for compname in self._poco_ordered_components:\n            comp_options = self._poco_component_tree[compname]\n            if comp_options.is_lib:\n                if not comp_options.option:\n                    libs.append(compname)\n                elif self.options.get_safe(comp_options.option, False):\n                    libs.append(compname)\n        return libs\n\n    def package_info(self):\n        suffix = str(self.settings.compiler.runtime).lower()  \\\n                 if self.settings.compiler == \"Visual Studio\" and not self.options.shared \\\n                 else (\"d\" if self.settings.build_type == \"Debug\" else \"\")\n\n        self.cpp_info.libs = list(\"{}{}\".format(lib, suffix) for lib in self._ordered_libs)\n\n        if self.settings.os == \"Linux\":\n            self.cpp_info.system_libs.extend([\"pthread\", \"dl\", \"rt\"])\n\n        if self.settings.compiler == \"Visual Studio\":\n            self.cpp_info.defines.append(\"POCO_NO_AUTOMATIC_LIBS\")\n        if not self.options.shared:\n            self.cpp_info.defines.append(\"POCO_STATIC=ON\")\n            if self.settings.os == \"Windows\":\n                self.cpp_info.system_libs.extend([\"ws2_32\", \"iphlpapi\", \"crypt32\"])\n        self.cpp_info.names[\"cmake_find_package\"] = \"Poco\"\n        self.cpp_info.names[\"cmake_find_package_multi\"] = \"Poco\"\n", "path": "recipes/poco/all/conanfile.py"}]}