We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[package] gtest/1.11.0: CMakeDeps + Conan 1.42 uses incorrect names for CMake config file, namespace, and gtest component
### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **gtest/3.1.0**
  * Operating System+version: **Fedora Silverblue 35**
  * Compiler+version: **GCC 11**
  * Conan version: **conan 1.42.0**
  * Python version: **Python 3.10.0**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
[settings]
os=Linux
arch=x86_64
compiler=gcc
compiler.version=11
compiler.libcxx=libstdc++11
compiler.cppstd=17
build_type=Debug
[options]
[conf]
[build_requires]
[env]
```


### Steps to reproduce (Include if Applicable)

Use the `CMakeToolchain` / `CMakeDeps` generator for a project and add `ms-gsl` as a `requires`.
In your `CMakeLists.txt` use `find_package(GTest)` and it will not be found during CMake's configure stage.
This is because the package is now named `gtest` instead, which is unexpected.
I don't think the component name for `libgtest` or the namespace for the CMake targets will be correct now either for the CMakeDeps generator.

### Logs (Include/Attach if Applicable)
<details><summary>Click to expand log</summary>

```
CMake Error at src/CMakeLists.txt:21 (add_executable):
  Target "TestDriver" links to target "GTest::gtest_main" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
CMake Error at src/CMakeLists.txt:21 (add_executable):
  Target "TestDriver" links to target "GTest::gtest_main" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
```

</details>


--- 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/gtest/all/conanfile.py`
Content:
```
1 from conans import ConanFile, CMake, tools
2 from conans.errors import ConanInvalidConfiguration
3 import os
4 import functools
5 
6 required_conan_version = ">=1.33.0"
7 
8 
9 class GTestConan(ConanFile):
10     name = "gtest"
11     description = "Google's C++ test framework"
12     url = "https://github.com/conan-io/conan-center-index"
13     homepage = "https://github.com/google/googletest"
14     license = "BSD-3-Clause"
15     topics = ("testing", "google-testing", "unit-test")
16     settings = "os", "arch", "compiler", "build_type"
17     options = {
18         "shared": [True, False],
19         "build_gmock": [True, False],
20         "fPIC": [True, False],
21         "no_main": [True, False],
22         "debug_postfix": "ANY",
23         "hide_symbols": [True, False],
24     }
25     default_options = {
26         "shared": False,
27         "build_gmock": True,
28         "fPIC": True,
29         "no_main": False,
30         "debug_postfix": "d",
31         "hide_symbols": False,
32     }
33 
34     exports_sources = "CMakeLists.txt", "patches/*"
35     generators = "cmake"
36 
37     @property
38     def _source_subfolder(self):
39         return "source_subfolder"
40 
41     @property
42     def _build_subfolder(self):
43         return "build_subfolder"
44 
45     @property
46     def _minimum_cpp_standard(self):
47         if self.version == "1.8.1":
48             return 98
49         else:
50             return 11
51 
52     @property
53     def _minimum_compilers_version(self):
54         if self.version == "1.8.1":
55             return {
56                 "Visual Studio": "14"
57             }
58         elif self.version == "1.10.0":
59             return {
60                 "Visual Studio": "14",
61                 "gcc": "4.8.1",
62                 "clang": "3.3",
63                 "apple-clang": "5.0"
64             }
65         else:
66             return {
67                 "Visual Studio": "14",
68                 "gcc": "5",
69                 "clang": "5",
70                 "apple-clang": "9.1"
71             }
72 
73     def config_options(self):
74         if self.settings.os == "Windows":
75             del self.options.fPIC
76         if self.settings.build_type != "Debug":
77             del self.options.debug_postfix
78 
79     def configure(self):
80         if self.options.shared:
81             del self.options.fPIC
82 
83     def validate(self):
84         if self.settings.get_safe("compiler.cppstd"):
85             tools.check_min_cppstd(self, self._minimum_cpp_standard)
86         min_version = self._minimum_compilers_version.get(
87             str(self.settings.compiler))
88         if self.settings.compiler == "Visual Studio":
89             if self.options.shared and "MT" in self.settings.compiler.runtime:
90                 raise ConanInvalidConfiguration("gtest:shared=True with compiler=\"Visual Studio\" is not compatible with compiler.runtime=MT/MTd")
91 
92         def lazy_lt_semver(v1, v2):
93             lv1 = [int(v) for v in v1.split(".")]
94             lv2 = [int(v) for v in v2.split(".")]
95             min_length = min(len(lv1), len(lv2))
96             return lv1[:min_length] < lv2[:min_length]
97 
98         if not min_version:
99             self.output.warn("{} recipe lacks information about {} compiler support.".format(
100                 self.name, self.settings.compiler))
101         else:
102             if lazy_lt_semver(str(self.settings.compiler.version), min_version):
103                 raise ConanInvalidConfiguration("{0} requires {1} {2}. The current compiler is {1} {3}.".format(
104                     self.name, self.settings.compiler, min_version, self.settings.compiler.version))
105 
106     def package_id(self):
107         del self.info.options.no_main
108 
109     def source(self):
110         tools.get(**self.conan_data["sources"][self.version],
111                   destination=self._source_subfolder, strip_root=True)
112 
113     @functools.lru_cache(1)
114     def _configure_cmake(self):
115         cmake = CMake(self)
116         if self.settings.build_type == "Debug":
117             cmake.definitions["CUSTOM_DEBUG_POSTFIX"] = self.options.debug_postfix
118         if self.settings.compiler == "Visual Studio":
119             cmake.definitions["gtest_force_shared_crt"] = "MD" in self.settings.compiler.runtime
120         cmake.definitions["BUILD_GMOCK"] = self.options.build_gmock
121         if self.settings.os == "Windows" and self.settings.compiler == "gcc":
122             cmake.definitions["gtest_disable_pthreads"] = True
123         cmake.definitions["gtest_hide_internal_symbols"] = self.options.hide_symbols
124         cmake.configure(build_folder=self._build_subfolder)
125         return cmake
126 
127     def build(self):
128         for patch in self.conan_data.get("patches", {}).get(self.version, []):
129             tools.patch(**patch)
130         cmake = self._configure_cmake()
131         cmake.build()
132 
133     def package(self):
134         self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
135         cmake = self._configure_cmake()
136         cmake.install()
137         tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
138         tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
139         tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb")
140 
141     @property
142     def _postfix(self):
143         return self.options.debug_postfix if self.settings.build_type == "Debug" else ""
144 
145     def package_info(self):
146         self.cpp_info.names["cmake_find_package"] = "GTest"
147         self.cpp_info.names["cmake_find_package_multi"] = "GTest"
148         self.cpp_info.components["libgtest"].names["cmake_find_package"] = "gtest"
149         self.cpp_info.components["libgtest"].names["cmake_find_package_multi"] = "gtest"
150         self.cpp_info.components["libgtest"].names["pkg_config"] = "gtest"
151         self.cpp_info.components["libgtest"].libs = ["gtest{}".format(self._postfix)]
152         if self.settings.os == "Linux":
153             self.cpp_info.components["libgtest"].system_libs.append("pthread")
154 
155         if self.settings.os == "Neutrino" and self.settings.os.version == "7.1":
156             self.cpp_info.components["libgtest"].system_libs.append("regex")
157 
158         if self.options.shared:
159             self.cpp_info.components["libgtest"].defines.append("GTEST_LINKED_AS_SHARED_LIBRARY=1")
160 
161         if self.version == "1.8.1":
162             if self.settings.compiler == "Visual Studio":
163                 if tools.Version(self.settings.compiler.version) >= "15":
164                     self.cpp_info.components["libgtest"].defines.append("GTEST_LANG_CXX11=1")
165                     self.cpp_info.components["libgtest"].defines.append("GTEST_HAS_TR1_TUPLE=0")
166 
167         if not self.options.no_main:
168             self.cpp_info.components["gtest_main"].libs = ["gtest_main{}".format(self._postfix)]
169             self.cpp_info.components["gtest_main"].requires = ["libgtest"]
170             self.cpp_info.components["gtest_main"].names["cmake_find_package"] = "gtest_main"
171             self.cpp_info.components["gtest_main"].names["cmake_find_package_multi"] = "gtest_main"
172             self.cpp_info.components["gtest_main"].names["pkg_config"] = "gtest_main"
173 
174         if self.options.build_gmock:
175             self.cpp_info.components["gmock"].names["cmake_find_package"] = "gmock"
176             self.cpp_info.components["gmock"].names["cmake_find_package_multi"] = "gmock"
177             self.cpp_info.components["gmock"].names["pkg_config"] = "gmock"
178             self.cpp_info.components["gmock"].libs = ["gmock{}".format(self._postfix)]
179             self.cpp_info.components["gmock"].requires = ["libgtest"]
180             if not self.options.no_main:
181                 self.cpp_info.components["gmock_main"].names["cmake_find_package"] = "gmock_main"
182                 self.cpp_info.components["gmock_main"].names["cmake_find_package_multi"] = "gmock_main"
183                 self.cpp_info.components["gmock_main"].names["pkg_config"] = "gmock_main"
184                 self.cpp_info.components["gmock_main"].libs = ["gmock_main{}".format(self._postfix)]
185                 self.cpp_info.components["gmock_main"].requires = ["gmock"]
186
```
--- 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/gtest/all/conanfile.py b/recipes/gtest/all/conanfile.py
--- a/recipes/gtest/all/conanfile.py
+++ b/recipes/gtest/all/conanfile.py
@@ -3,7 +3,7 @@
 import os
 import functools
 
-required_conan_version = ">=1.33.0"
+required_conan_version = ">=1.36.0"
 
 
 class GTestConan(ConanFile):
@@ -143,11 +143,10 @@
         return self.options.debug_postfix if self.settings.build_type == "Debug" else ""
 
     def package_info(self):
-        self.cpp_info.names["cmake_find_package"] = "GTest"
-        self.cpp_info.names["cmake_find_package_multi"] = "GTest"
-        self.cpp_info.components["libgtest"].names["cmake_find_package"] = "gtest"
-        self.cpp_info.components["libgtest"].names["cmake_find_package_multi"] = "gtest"
-        self.cpp_info.components["libgtest"].names["pkg_config"] = "gtest"
+        self.cpp_info.set_property("cmake_file_name", "GTest")
+        self.cpp_info.set_property("cmake_target_name", "GTest")
+        self.cpp_info.components["libgtest"].set_property("cmake_target_name", "gtest")
+        self.cpp_info.components["libgtest"].set_property("pkg_config_name", "gtest")
         self.cpp_info.components["libgtest"].libs = ["gtest{}".format(self._postfix)]
         if self.settings.os == "Linux":
             self.cpp_info.components["libgtest"].system_libs.append("pthread")
@@ -165,21 +164,18 @@
                     self.cpp_info.components["libgtest"].defines.append("GTEST_HAS_TR1_TUPLE=0")
 
         if not self.options.no_main:
+            self.cpp_info.components["gtest_main"].set_property("cmake_target_name", "gtest_main")
+            self.cpp_info.components["gtest_main"].set_property("pkg_config_name", "gtest_main")
             self.cpp_info.components["gtest_main"].libs = ["gtest_main{}".format(self._postfix)]
             self.cpp_info.components["gtest_main"].requires = ["libgtest"]
-            self.cpp_info.components["gtest_main"].names["cmake_find_package"] = "gtest_main"
-            self.cpp_info.components["gtest_main"].names["cmake_find_package_multi"] = "gtest_main"
-            self.cpp_info.components["gtest_main"].names["pkg_config"] = "gtest_main"
 
         if self.options.build_gmock:
-            self.cpp_info.components["gmock"].names["cmake_find_package"] = "gmock"
-            self.cpp_info.components["gmock"].names["cmake_find_package_multi"] = "gmock"
-            self.cpp_info.components["gmock"].names["pkg_config"] = "gmock"
+            self.cpp_info.components["gmock"].set_property("cmake_target_name", "gmock")
+            self.cpp_info.components["gmock"].set_property("pkg_config_name", "gmock")
             self.cpp_info.components["gmock"].libs = ["gmock{}".format(self._postfix)]
             self.cpp_info.components["gmock"].requires = ["libgtest"]
             if not self.options.no_main:
-                self.cpp_info.components["gmock_main"].names["cmake_find_package"] = "gmock_main"
-                self.cpp_info.components["gmock_main"].names["cmake_find_package_multi"] = "gmock_main"
-                self.cpp_info.components["gmock_main"].names["pkg_config"] = "gmock_main"
+                self.cpp_info.components["gmock_main"].set_property("cmake_target_name", "gmock_main")
+                self.cpp_info.components["gmock_main"].set_property("pkg_config_name", "gmock_main")
                 self.cpp_info.components["gmock_main"].libs = ["gmock_main{}".format(self._postfix)]
                 self.cpp_info.components["gmock_main"].requires = ["gmock"]

{"golden_diff": "diff --git a/recipes/gtest/all/conanfile.py b/recipes/gtest/all/conanfile.py\n--- a/recipes/gtest/all/conanfile.py\n+++ b/recipes/gtest/all/conanfile.py\n@@ -3,7 +3,7 @@\n import os\n import functools\n \n-required_conan_version = \">=1.33.0\"\n+required_conan_version = \">=1.36.0\"\n \n \n class GTestConan(ConanFile):\n@@ -143,11 +143,10 @@\n         return self.options.debug_postfix if self.settings.build_type == \"Debug\" else \"\"\n \n     def package_info(self):\n-        self.cpp_info.names[\"cmake_find_package\"] = \"GTest\"\n-        self.cpp_info.names[\"cmake_find_package_multi\"] = \"GTest\"\n-        self.cpp_info.components[\"libgtest\"].names[\"cmake_find_package\"] = \"gtest\"\n-        self.cpp_info.components[\"libgtest\"].names[\"cmake_find_package_multi\"] = \"gtest\"\n-        self.cpp_info.components[\"libgtest\"].names[\"pkg_config\"] = \"gtest\"\n+        self.cpp_info.set_property(\"cmake_file_name\", \"GTest\")\n+        self.cpp_info.set_property(\"cmake_target_name\", \"GTest\")\n+        self.cpp_info.components[\"libgtest\"].set_property(\"cmake_target_name\", \"gtest\")\n+        self.cpp_info.components[\"libgtest\"].set_property(\"pkg_config_name\", \"gtest\")\n         self.cpp_info.components[\"libgtest\"].libs = [\"gtest{}\".format(self._postfix)]\n         if self.settings.os == \"Linux\":\n             self.cpp_info.components[\"libgtest\"].system_libs.append(\"pthread\")\n@@ -165,21 +164,18 @@\n                     self.cpp_info.components[\"libgtest\"].defines.append(\"GTEST_HAS_TR1_TUPLE=0\")\n \n         if not self.options.no_main:\n+            self.cpp_info.components[\"gtest_main\"].set_property(\"cmake_target_name\", \"gtest_main\")\n+            self.cpp_info.components[\"gtest_main\"].set_property(\"pkg_config_name\", \"gtest_main\")\n             self.cpp_info.components[\"gtest_main\"].libs = [\"gtest_main{}\".format(self._postfix)]\n             self.cpp_info.components[\"gtest_main\"].requires = [\"libgtest\"]\n-            self.cpp_info.components[\"gtest_main\"].names[\"cmake_find_package\"] = \"gtest_main\"\n-            self.cpp_info.components[\"gtest_main\"].names[\"cmake_find_package_multi\"] = \"gtest_main\"\n-            self.cpp_info.components[\"gtest_main\"].names[\"pkg_config\"] = \"gtest_main\"\n \n         if self.options.build_gmock:\n-            self.cpp_info.components[\"gmock\"].names[\"cmake_find_package\"] = \"gmock\"\n-            self.cpp_info.components[\"gmock\"].names[\"cmake_find_package_multi\"] = \"gmock\"\n-            self.cpp_info.components[\"gmock\"].names[\"pkg_config\"] = \"gmock\"\n+            self.cpp_info.components[\"gmock\"].set_property(\"cmake_target_name\", \"gmock\")\n+            self.cpp_info.components[\"gmock\"].set_property(\"pkg_config_name\", \"gmock\")\n             self.cpp_info.components[\"gmock\"].libs = [\"gmock{}\".format(self._postfix)]\n             self.cpp_info.components[\"gmock\"].requires = [\"libgtest\"]\n             if not self.options.no_main:\n-                self.cpp_info.components[\"gmock_main\"].names[\"cmake_find_package\"] = \"gmock_main\"\n-                self.cpp_info.components[\"gmock_main\"].names[\"cmake_find_package_multi\"] = \"gmock_main\"\n-                self.cpp_info.components[\"gmock_main\"].names[\"pkg_config\"] = \"gmock_main\"\n+                self.cpp_info.components[\"gmock_main\"].set_property(\"cmake_target_name\", \"gmock_main\")\n+                self.cpp_info.components[\"gmock_main\"].set_property(\"pkg_config_name\", \"gmock_main\")\n                 self.cpp_info.components[\"gmock_main\"].libs = [\"gmock_main{}\".format(self._postfix)]\n                 self.cpp_info.components[\"gmock_main\"].requires = [\"gmock\"]\n", "issue": "[package] gtest/1.11.0: CMakeDeps + Conan 1.42 uses incorrect names for CMake config file, namespace, and gtest component\n### Package and Environment Details (include every applicable attribute)\r\n  * Package Name/Version: **gtest/3.1.0**\r\n  * Operating System+version: **Fedora Silverblue 35**\r\n  * Compiler+version: **GCC 11**\r\n  * Conan version: **conan 1.42.0**\r\n  * Python version: **Python 3.10.0**\r\n\r\n\r\n### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)\r\n```\r\n[settings]\r\nos=Linux\r\narch=x86_64\r\ncompiler=gcc\r\ncompiler.version=11\r\ncompiler.libcxx=libstdc++11\r\ncompiler.cppstd=17\r\nbuild_type=Debug\r\n[options]\r\n[conf]\r\n[build_requires]\r\n[env]\r\n```\r\n\r\n\r\n### Steps to reproduce (Include if Applicable)\r\n\r\nUse the `CMakeToolchain` / `CMakeDeps` generator for a project and add `ms-gsl` as a `requires`.\r\nIn your `CMakeLists.txt` use `find_package(GTest)` and it will not be found during CMake's configure stage.\r\nThis is because the package is now named `gtest` instead, which is unexpected.\r\nI don't think the component name for `libgtest` or the namespace for the CMake targets will be correct now either for the CMakeDeps generator.\r\n\r\n### Logs (Include/Attach if Applicable)\r\n<details><summary>Click to expand log</summary>\r\n\r\n```\r\nCMake Error at src/CMakeLists.txt:21 (add_executable):\r\n  Target \"TestDriver\" links to target \"GTest::gtest_main\" but the target was\r\n  not found.  Perhaps a find_package() call is missing for an IMPORTED\r\n  target, or an ALIAS target is missing?\r\nCMake Error at src/CMakeLists.txt:21 (add_executable):\r\n  Target \"TestDriver\" links to target \"GTest::gtest_main\" but the target was\r\n  not found.  Perhaps a find_package() call is missing for an IMPORTED\r\n  target, or an ALIAS target is missing?\r\n```\r\n\r\n</details>\r\n\n", "before_files": [{"content": "from conans import ConanFile, CMake, tools\nfrom conans.errors import ConanInvalidConfiguration\nimport os\nimport functools\n\nrequired_conan_version = \">=1.33.0\"\n\n\nclass GTestConan(ConanFile):\n    name = \"gtest\"\n    description = \"Google's C++ test framework\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://github.com/google/googletest\"\n    license = \"BSD-3-Clause\"\n    topics = (\"testing\", \"google-testing\", \"unit-test\")\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\n        \"shared\": [True, False],\n        \"build_gmock\": [True, False],\n        \"fPIC\": [True, False],\n        \"no_main\": [True, False],\n        \"debug_postfix\": \"ANY\",\n        \"hide_symbols\": [True, False],\n    }\n    default_options = {\n        \"shared\": False,\n        \"build_gmock\": True,\n        \"fPIC\": True,\n        \"no_main\": False,\n        \"debug_postfix\": \"d\",\n        \"hide_symbols\": False,\n    }\n\n    exports_sources = \"CMakeLists.txt\", \"patches/*\"\n    generators = \"cmake\"\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    @property\n    def _minimum_cpp_standard(self):\n        if self.version == \"1.8.1\":\n            return 98\n        else:\n            return 11\n\n    @property\n    def _minimum_compilers_version(self):\n        if self.version == \"1.8.1\":\n            return {\n                \"Visual Studio\": \"14\"\n            }\n        elif self.version == \"1.10.0\":\n            return {\n                \"Visual Studio\": \"14\",\n                \"gcc\": \"4.8.1\",\n                \"clang\": \"3.3\",\n                \"apple-clang\": \"5.0\"\n            }\n        else:\n            return {\n                \"Visual Studio\": \"14\",\n                \"gcc\": \"5\",\n                \"clang\": \"5\",\n                \"apple-clang\": \"9.1\"\n            }\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n        if self.settings.build_type != \"Debug\":\n            del self.options.debug_postfix\n\n    def configure(self):\n        if self.options.shared:\n            del self.options.fPIC\n\n    def validate(self):\n        if self.settings.get_safe(\"compiler.cppstd\"):\n            tools.check_min_cppstd(self, self._minimum_cpp_standard)\n        min_version = self._minimum_compilers_version.get(\n            str(self.settings.compiler))\n        if self.settings.compiler == \"Visual Studio\":\n            if self.options.shared and \"MT\" in self.settings.compiler.runtime:\n                raise ConanInvalidConfiguration(\"gtest:shared=True with compiler=\\\"Visual Studio\\\" is not compatible with compiler.runtime=MT/MTd\")\n\n        def lazy_lt_semver(v1, v2):\n            lv1 = [int(v) for v in v1.split(\".\")]\n            lv2 = [int(v) for v in v2.split(\".\")]\n            min_length = min(len(lv1), len(lv2))\n            return lv1[:min_length] < lv2[:min_length]\n\n        if not min_version:\n            self.output.warn(\"{} recipe lacks information about {} compiler support.\".format(\n                self.name, self.settings.compiler))\n        else:\n            if lazy_lt_semver(str(self.settings.compiler.version), min_version):\n                raise ConanInvalidConfiguration(\"{0} requires {1} {2}. The current compiler is {1} {3}.\".format(\n                    self.name, self.settings.compiler, min_version, self.settings.compiler.version))\n\n    def package_id(self):\n        del self.info.options.no_main\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version],\n                  destination=self._source_subfolder, strip_root=True)\n\n    @functools.lru_cache(1)\n    def _configure_cmake(self):\n        cmake = CMake(self)\n        if self.settings.build_type == \"Debug\":\n            cmake.definitions[\"CUSTOM_DEBUG_POSTFIX\"] = self.options.debug_postfix\n        if self.settings.compiler == \"Visual Studio\":\n            cmake.definitions[\"gtest_force_shared_crt\"] = \"MD\" in self.settings.compiler.runtime\n        cmake.definitions[\"BUILD_GMOCK\"] = self.options.build_gmock\n        if self.settings.os == \"Windows\" and self.settings.compiler == \"gcc\":\n            cmake.definitions[\"gtest_disable_pthreads\"] = True\n        cmake.definitions[\"gtest_hide_internal_symbols\"] = self.options.hide_symbols\n        cmake.configure(build_folder=self._build_subfolder)\n        return cmake\n\n    def build(self):\n        for patch in self.conan_data.get(\"patches\", {}).get(self.version, []):\n            tools.patch(**patch)\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\", \"pkgconfig\"))\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        tools.remove_files_by_mask(os.path.join(self.package_folder, \"lib\"), \"*.pdb\")\n\n    @property\n    def _postfix(self):\n        return self.options.debug_postfix if self.settings.build_type == \"Debug\" else \"\"\n\n    def package_info(self):\n        self.cpp_info.names[\"cmake_find_package\"] = \"GTest\"\n        self.cpp_info.names[\"cmake_find_package_multi\"] = \"GTest\"\n        self.cpp_info.components[\"libgtest\"].names[\"cmake_find_package\"] = \"gtest\"\n        self.cpp_info.components[\"libgtest\"].names[\"cmake_find_package_multi\"] = \"gtest\"\n        self.cpp_info.components[\"libgtest\"].names[\"pkg_config\"] = \"gtest\"\n        self.cpp_info.components[\"libgtest\"].libs = [\"gtest{}\".format(self._postfix)]\n        if self.settings.os == \"Linux\":\n            self.cpp_info.components[\"libgtest\"].system_libs.append(\"pthread\")\n\n        if self.settings.os == \"Neutrino\" and self.settings.os.version == \"7.1\":\n            self.cpp_info.components[\"libgtest\"].system_libs.append(\"regex\")\n\n        if self.options.shared:\n            self.cpp_info.components[\"libgtest\"].defines.append(\"GTEST_LINKED_AS_SHARED_LIBRARY=1\")\n\n        if self.version == \"1.8.1\":\n            if self.settings.compiler == \"Visual Studio\":\n                if tools.Version(self.settings.compiler.version) >= \"15\":\n                    self.cpp_info.components[\"libgtest\"].defines.append(\"GTEST_LANG_CXX11=1\")\n                    self.cpp_info.components[\"libgtest\"].defines.append(\"GTEST_HAS_TR1_TUPLE=0\")\n\n        if not self.options.no_main:\n            self.cpp_info.components[\"gtest_main\"].libs = [\"gtest_main{}\".format(self._postfix)]\n            self.cpp_info.components[\"gtest_main\"].requires = [\"libgtest\"]\n            self.cpp_info.components[\"gtest_main\"].names[\"cmake_find_package\"] = \"gtest_main\"\n            self.cpp_info.components[\"gtest_main\"].names[\"cmake_find_package_multi\"] = \"gtest_main\"\n            self.cpp_info.components[\"gtest_main\"].names[\"pkg_config\"] = \"gtest_main\"\n\n        if self.options.build_gmock:\n            self.cpp_info.components[\"gmock\"].names[\"cmake_find_package\"] = \"gmock\"\n            self.cpp_info.components[\"gmock\"].names[\"cmake_find_package_multi\"] = \"gmock\"\n            self.cpp_info.components[\"gmock\"].names[\"pkg_config\"] = \"gmock\"\n            self.cpp_info.components[\"gmock\"].libs = [\"gmock{}\".format(self._postfix)]\n            self.cpp_info.components[\"gmock\"].requires = [\"libgtest\"]\n            if not self.options.no_main:\n                self.cpp_info.components[\"gmock_main\"].names[\"cmake_find_package\"] = \"gmock_main\"\n                self.cpp_info.components[\"gmock_main\"].names[\"cmake_find_package_multi\"] = \"gmock_main\"\n                self.cpp_info.components[\"gmock_main\"].names[\"pkg_config\"] = \"gmock_main\"\n                self.cpp_info.components[\"gmock_main\"].libs = [\"gmock_main{}\".format(self._postfix)]\n                self.cpp_info.components[\"gmock_main\"].requires = [\"gmock\"]\n", "path": "recipes/gtest/all/conanfile.py"}], "after_files": [{"content": "from conans import ConanFile, CMake, tools\nfrom conans.errors import ConanInvalidConfiguration\nimport os\nimport functools\n\nrequired_conan_version = \">=1.36.0\"\n\n\nclass GTestConan(ConanFile):\n    name = \"gtest\"\n    description = \"Google's C++ test framework\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://github.com/google/googletest\"\n    license = \"BSD-3-Clause\"\n    topics = (\"testing\", \"google-testing\", \"unit-test\")\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\n        \"shared\": [True, False],\n        \"build_gmock\": [True, False],\n        \"fPIC\": [True, False],\n        \"no_main\": [True, False],\n        \"debug_postfix\": \"ANY\",\n        \"hide_symbols\": [True, False],\n    }\n    default_options = {\n        \"shared\": False,\n        \"build_gmock\": True,\n        \"fPIC\": True,\n        \"no_main\": False,\n        \"debug_postfix\": \"d\",\n        \"hide_symbols\": False,\n    }\n\n    exports_sources = \"CMakeLists.txt\", \"patches/*\"\n    generators = \"cmake\"\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    @property\n    def _minimum_cpp_standard(self):\n        if self.version == \"1.8.1\":\n            return 98\n        else:\n            return 11\n\n    @property\n    def _minimum_compilers_version(self):\n        if self.version == \"1.8.1\":\n            return {\n                \"Visual Studio\": \"14\"\n            }\n        elif self.version == \"1.10.0\":\n            return {\n                \"Visual Studio\": \"14\",\n                \"gcc\": \"4.8.1\",\n                \"clang\": \"3.3\",\n                \"apple-clang\": \"5.0\"\n            }\n        else:\n            return {\n                \"Visual Studio\": \"14\",\n                \"gcc\": \"5\",\n                \"clang\": \"5\",\n                \"apple-clang\": \"9.1\"\n            }\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n        if self.settings.build_type != \"Debug\":\n            del self.options.debug_postfix\n\n    def configure(self):\n        if self.options.shared:\n            del self.options.fPIC\n\n    def validate(self):\n        if self.settings.get_safe(\"compiler.cppstd\"):\n            tools.check_min_cppstd(self, self._minimum_cpp_standard)\n        min_version = self._minimum_compilers_version.get(\n            str(self.settings.compiler))\n        if self.settings.compiler == \"Visual Studio\":\n            if self.options.shared and \"MT\" in self.settings.compiler.runtime:\n                raise ConanInvalidConfiguration(\"gtest:shared=True with compiler=\\\"Visual Studio\\\" is not compatible with compiler.runtime=MT/MTd\")\n\n        def lazy_lt_semver(v1, v2):\n            lv1 = [int(v) for v in v1.split(\".\")]\n            lv2 = [int(v) for v in v2.split(\".\")]\n            min_length = min(len(lv1), len(lv2))\n            return lv1[:min_length] < lv2[:min_length]\n\n        if not min_version:\n            self.output.warn(\"{} recipe lacks information about {} compiler support.\".format(\n                self.name, self.settings.compiler))\n        else:\n            if lazy_lt_semver(str(self.settings.compiler.version), min_version):\n                raise ConanInvalidConfiguration(\"{0} requires {1} {2}. The current compiler is {1} {3}.\".format(\n                    self.name, self.settings.compiler, min_version, self.settings.compiler.version))\n\n    def package_id(self):\n        del self.info.options.no_main\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version],\n                  destination=self._source_subfolder, strip_root=True)\n\n    @functools.lru_cache(1)\n    def _configure_cmake(self):\n        cmake = CMake(self)\n        if self.settings.build_type == \"Debug\":\n            cmake.definitions[\"CUSTOM_DEBUG_POSTFIX\"] = self.options.debug_postfix\n        if self.settings.compiler == \"Visual Studio\":\n            cmake.definitions[\"gtest_force_shared_crt\"] = \"MD\" in self.settings.compiler.runtime\n        cmake.definitions[\"BUILD_GMOCK\"] = self.options.build_gmock\n        if self.settings.os == \"Windows\" and self.settings.compiler == \"gcc\":\n            cmake.definitions[\"gtest_disable_pthreads\"] = True\n        cmake.definitions[\"gtest_hide_internal_symbols\"] = self.options.hide_symbols\n        cmake.configure(build_folder=self._build_subfolder)\n        return cmake\n\n    def build(self):\n        for patch in self.conan_data.get(\"patches\", {}).get(self.version, []):\n            tools.patch(**patch)\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\", \"pkgconfig\"))\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        tools.remove_files_by_mask(os.path.join(self.package_folder, \"lib\"), \"*.pdb\")\n\n    @property\n    def _postfix(self):\n        return self.options.debug_postfix if self.settings.build_type == \"Debug\" else \"\"\n\n    def package_info(self):\n        self.cpp_info.set_property(\"cmake_file_name\", \"GTest\")\n        self.cpp_info.set_property(\"cmake_target_name\", \"GTest\")\n        self.cpp_info.components[\"libgtest\"].set_property(\"cmake_target_name\", \"gtest\")\n        self.cpp_info.components[\"libgtest\"].set_property(\"pkg_config_name\", \"gtest\")\n        self.cpp_info.components[\"libgtest\"].libs = [\"gtest{}\".format(self._postfix)]\n        if self.settings.os == \"Linux\":\n            self.cpp_info.components[\"libgtest\"].system_libs.append(\"pthread\")\n\n        if self.settings.os == \"Neutrino\" and self.settings.os.version == \"7.1\":\n            self.cpp_info.components[\"libgtest\"].system_libs.append(\"regex\")\n\n        if self.options.shared:\n            self.cpp_info.components[\"libgtest\"].defines.append(\"GTEST_LINKED_AS_SHARED_LIBRARY=1\")\n\n        if self.version == \"1.8.1\":\n            if self.settings.compiler == \"Visual Studio\":\n                if tools.Version(self.settings.compiler.version) >= \"15\":\n                    self.cpp_info.components[\"libgtest\"].defines.append(\"GTEST_LANG_CXX11=1\")\n                    self.cpp_info.components[\"libgtest\"].defines.append(\"GTEST_HAS_TR1_TUPLE=0\")\n\n        if not self.options.no_main:\n            self.cpp_info.components[\"gtest_main\"].set_property(\"cmake_target_name\", \"gtest_main\")\n            self.cpp_info.components[\"gtest_main\"].set_property(\"pkg_config_name\", \"gtest_main\")\n            self.cpp_info.components[\"gtest_main\"].libs = [\"gtest_main{}\".format(self._postfix)]\n            self.cpp_info.components[\"gtest_main\"].requires = [\"libgtest\"]\n\n        if self.options.build_gmock:\n            self.cpp_info.components[\"gmock\"].set_property(\"cmake_target_name\", \"gmock\")\n            self.cpp_info.components[\"gmock\"].set_property(\"pkg_config_name\", \"gmock\")\n            self.cpp_info.components[\"gmock\"].libs = [\"gmock{}\".format(self._postfix)]\n            self.cpp_info.components[\"gmock\"].requires = [\"libgtest\"]\n            if not self.options.no_main:\n                self.cpp_info.components[\"gmock_main\"].set_property(\"cmake_target_name\", \"gmock_main\")\n                self.cpp_info.components[\"gmock_main\"].set_property(\"pkg_config_name\", \"gmock_main\")\n                self.cpp_info.components[\"gmock_main\"].libs = [\"gmock_main{}\".format(self._postfix)]\n                self.cpp_info.components[\"gmock_main\"].requires = [\"gmock\"]\n", "path": "recipes/gtest/all/conanfile.py"}]}