We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[question] CLI command to discover the cmake_find_package filename from the Conan package name?
The `cmake_find_package` generator writes a Find Module file that defines a target in a namespace. Each of these three names (filename, namespace, target) are [configurable](https://github.com/conan-io/conan/issues/7254) in `cpp_info`. For example,

```python
        self.cpp_info.filename['cmake_find_package'] = 'BoostFile'
        self.cpp_info.names['cmake_find_package'] = 'BoostNamespace'
        self.cpp_info.name = 'BoostTarget'
```

will generate a file named `FindBoostFile.cmake` that is used like this:

```cmake
find_package(BoostFile)
target_link_libraries(${target} BoostNamespace::BoostTarget)
```

Is there a CLI command that can print out these values given a package reference? Something like

```
$ conan inspect -a cpp_info.names.cmake_find_package boost/1.73.0@
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `conans/client/generators/markdown.py`
Content:
```
1 import os
2 import textwrap
3 
4 from jinja2 import DictLoader
5 from jinja2 import Environment
6 from conans.model import Generator
7 import datetime
8 
9 
10 
11 render_cpp_info = textwrap.dedent("""
12     {% macro join_list_sources(items) -%}
13     ``{{ "``, ``".join(items) }}``
14     {%- endmacro %}
15 
16     {% macro render_cpp_info(cpp_info) -%}
17     {%- if cpp_info.requires is iterable and cpp_info.requires %}
18     * Requires: {{ join_list_sources(cpp_info.requires) }}
19     {%- endif %}
20     {%- if cpp_info.libs %}
21     * Libraries: {{ join_list_sources(cpp_info.libs) }}
22     {%- endif %}
23     {%- if cpp_info.system_libs %}
24     * Systems libs: {{ join_list_sources(cpp_info.system_libs) }}
25     {%- endif %}
26     {%- if cpp_info.defines %}
27     * Preprocessor definitions: {{ join_list_sources(cpp_info.defines) }}
28     {%- endif %}
29     {%- if cpp_info.cflags %}
30     * C_FLAGS: {{ join_list_sources(cpp_info.cflags) }}
31     {%- endif %}
32     {%- if cpp_info.cxxflags %}
33     * CXX_FLAGS: {{ join_list_sources(cpp_info.cxxflags) }}
34     {%- endif %}
35     {%- if cpp_info.build_modules %}
36     * Build modules (see [below](#build-modules)): {{ join_list_sources(cpp_info.build_modules) }}
37     {%- endif %}
38     {%- endmacro %}
39 """)
40 
41 generator_cmake_tpl = textwrap.dedent("""
42     ### Generator ``cmake``
43 
44     Add these lines to your *CMakeLists.txt*:
45 
46     ```cmake
47     include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
48     conan_basic_setup(TARGETS)
49 
50     target_link_libraries(<library_name> CONAN_PKG::{{ cpp_info.get_name("cmake") }})
51     ```
52 """)
53 
54 generator_cmake_find_package_tpl = textwrap.dedent("""
55     ### Generator ``cmake_find_package``
56 
57     Add these lines to your *CMakeLists.txt*:
58 
59     ```cmake
60     find_package({{ cpp_info.get_filename("cmake_find_package") }})
61 
62     # Use the global target
63     target_link_libraries(<library_name> {{ cpp_info.get_name("cmake_find_package") }}::{{ cpp_info.get_name("cmake_find_package") }})
64     {% if cpp_info.components %}
65     # Or link just one of its components
66     {% for cmp_name, cmp_cpp_info in cpp_info.components.items() -%}
67     target_link_libraries(<library_name> {{ cpp_info.get_name("cmake_find_package") }}::{{ cmp_cpp_info.get_name("cmake_find_package") }})
68     {% endfor %}
69     {%- endif %}
70     ```
71 
72     Remember to adjust your build system settings to match the binaries you are linking with. You can
73     use the [CMake build helper](https://docs.conan.io/en/latest/reference/build_helpers/cmake.html) and
74     the ``cmake`` generator from a *conanfile.py* or the new [toolchain paradigm](https://docs.conan.io/en/latest/creating_packages/toolchains.html).
75 """)
76 
77 generator_pkg_config_tpl = textwrap.dedent("""
78     ### Generator ``pkg_config``
79 
80     This package provides one *pkg-config* file ``{{ cpp_info.get_filename('pkg_config') }}.pc`` with
81     all the information from the library
82     {% if cpp_info.components -%}
83     and another file for each of its components:
84     {%- for cmp_name, cmp_cpp_info in cpp_info.components.items() -%}
85     ``{{ cmp_cpp_info.get_filename('pkg_config') }}.pc``{% if not loop.last %},{% endif %}
86     {%- endfor -%}
87     {%- endif -%}.
88     Use your *pkg-config* tool as usual to consume the information provided by the Conan package.
89 """)
90 
91 requirement_tpl = textwrap.dedent("""
92     {% from 'render_cpp_info' import render_cpp_info %}
93 
94     # {{ cpp_info.name }}/{{ cpp_info.version }}
95 
96     ---
97     **Note.-** If this package belongs to ConanCenter, you can find more information [here](https://conan.io/center/{{ cpp_info.name }}/{{ cpp_info.version }}/).
98 
99     ---
100 
101     {% if requires or required_by %}
102     Graph of dependencies:
103     {% if requires %}
104     * ``{{ cpp_info.name }}`` requires:
105         {% for dep_name, dep_cpp_info in requires -%}
106         [{{ dep_name }}/{{ dep_cpp_info.version }}]({{ dep_name }}.md){% if not loop.last %}, {% endif %}
107         {%- endfor -%}
108     {%- endif %}
109     {%- if required_by %}
110     * ``{{ cpp_info.name }}`` is required by:
111         {%- for dep_name, dep_cpp_info in required_by %}
112         [{{ dep_name }}/{{ dep_cpp_info.version }}]({{ dep_name }}.md){% if not loop.last %}, {% endif %}
113         {%- endfor %}
114     {%- endif %}
115     {% endif %}
116 
117     Information published by ``{{ cpp_info.name }}`` to consumers:
118 
119     {%- if cpp_info.includedirs %}
120     * Headers (see [below](#header-files))
121     {%- endif %}
122     {% if cpp_info.components %}
123     {% for cmp_name, cmp_cpp_info in cpp_info.components.items() %}
124     * Component ``{{ cpp_info.name }}::{{ cmp_name }}``:
125     {{ render_cpp_info(cmp_cpp_info)|indent(width=2) }}
126     {%- endfor %}
127     {% else %}
128     {{ render_cpp_info(cpp_info)|indent(width=0) }}
129     {% endif %}
130 
131 
132     ## Generators
133 
134     Read below how to use this package using different
135     [generators](https://docs.conan.io/en/latest/reference/generators.html). In order to use
136     these generators they have to be listed in the _conanfile.py_ file or using the command
137     line argument ``--generator/-g`` in the ``conan install`` command.
138 
139 
140     {% include 'generator_cmake' %}
141     {% include 'generator_cmake_find_package' %}
142     {% include 'generator_pkg_config_tpl' %}
143 
144     ---
145     ## Header files
146 
147     List of header files exposed by this package. Use them in your ``#include`` directives:
148 
149     ```cpp
150     {%- for header in headers %}
151     {{ header }}
152     {%- endfor %}
153     ```
154 
155     {%- if cpp_info.build_modules %}
156     ---
157     ## Build modules
158 
159     Modules exported by this recipe. They are automatically included when using Conan generators:
160 
161     {% for name, build_module in build_modules %}
162     **{{ name }}**
163     ```
164     {{ build_module }}
165     ```
166     {% endfor %}
167     {% endif %}
168 
169     ---
170     ---
171     Conan **{{ conan_version }}**. JFrog LTD. [https://conan.io](https://conan.io). Autogenerated {{ now.strftime('%Y-%m-%d %H:%M:%S') }}.
172 """)
173 
174 
175 class MarkdownGenerator(Generator):
176 
177     def _list_headers(self, cpp_info):
178         rootpath = cpp_info.rootpath
179         for include_dir in cpp_info.includedirs:
180             for root, _, files in os.walk(os.path.join(cpp_info.rootpath, include_dir)):
181                 for f in files:
182                     yield os.path.relpath(os.path.join(root, f), os.path.join(rootpath, include_dir))
183 
184     def _list_requires(self, cpp_info):
185         return [(it, self.conanfile.deps_cpp_info[it]) for it in cpp_info.public_deps]
186 
187     def _list_required_by(self, cpp_info):
188         for other_name, other_cpp_info in self.conanfile.deps_cpp_info.dependencies:
189             if cpp_info.name in other_cpp_info.public_deps:
190                 yield other_name, other_cpp_info
191 
192     def _read_build_modules(self, cpp_info):
193         for build_module in cpp_info.build_modules:
194             filename = os.path.join(cpp_info.rootpath, build_module)
195             yield build_module, open(filename, 'r').read()
196 
197     @property
198     def filename(self):
199         pass
200 
201     @property
202     def content(self):
203         dict_loader = DictLoader({
204             'render_cpp_info': render_cpp_info,
205             'package.md': requirement_tpl,
206             'generator_cmake': generator_cmake_tpl,
207             'generator_cmake_find_package': generator_cmake_find_package_tpl,
208             'generator_pkg_config_tpl': generator_pkg_config_tpl,
209         })
210         env = Environment(loader=dict_loader)
211         template = env.get_template('package.md')
212 
213         from conans import __version__ as conan_version
214         ret = {}
215         for name, cpp_info in self.conanfile.deps_cpp_info.dependencies:
216             ret["{}.md".format(name)] = template.render(
217                 cpp_info=cpp_info,
218                 headers=self._list_headers(cpp_info),
219                 requires=list(self._list_requires(cpp_info)),
220                 required_by=list(self._list_required_by(cpp_info)),
221                 build_modules=self._read_build_modules(cpp_info),
222                 conan_version=conan_version,
223                 now=datetime.datetime.now()
224             )
225         return ret
226
```

Path: `conans/client/generators/json_generator.py`
Content:
```
1 import json
2 
3 from conans.model import Generator
4 
5 
6 def serialize_cpp_info(cpp_info):
7     keys = [
8         "version",
9         "description",
10         "rootpath",
11         "sysroot",
12         "include_paths", "lib_paths", "bin_paths", "build_paths", "res_paths",
13         "libs",
14         "system_libs",
15         "defines", "cflags", "cxxflags", "sharedlinkflags", "exelinkflags",
16         "frameworks", "framework_paths"
17     ]
18     res = {}
19     for key in keys:
20         res[key] = getattr(cpp_info, key)
21     res["cppflags"] = cpp_info.cxxflags  # Backwards compatibility
22     return res
23 
24 
25 def serialize_user_info(user_info):
26     res = {}
27     for key, value in user_info.items():
28         res[key] = value.vars
29     return res
30 
31 
32 class JsonGenerator(Generator):
33     @property
34     def filename(self):
35         return "conanbuildinfo.json"
36 
37     @property
38     def content(self):
39         info = {}
40         info["deps_env_info"] = self.deps_env_info.vars
41         info["deps_user_info"] = serialize_user_info(self.deps_user_info)
42         info["dependencies"] = self.get_dependencies_info()
43         info["settings"] = self.get_settings()
44         info["options"] = self.get_options()
45         if self._user_info_build:
46             info["user_info_build"] = serialize_user_info(self._user_info_build)
47 
48         return json.dumps(info, indent=2)
49 
50     def get_dependencies_info(self):
51         res = []
52         for depname, cpp_info in self.deps_build_info.dependencies:
53             serialized_info = serialize_cpp_info(cpp_info)
54             serialized_info["name"] = depname
55             for cfg, cfg_cpp_info in cpp_info.configs.items():
56                 serialized_info.setdefault("configs", {})[cfg] = serialize_cpp_info(cfg_cpp_info)
57             res.append(serialized_info)
58         return res
59 
60     def get_settings(self):
61         settings = {}
62         for key, value in self.settings.items():
63             settings[key] = value
64         return settings
65 
66     def get_options(self):
67         options = {}
68         for req in self.conanfile.requires:
69             options[req] = {}
70             for key, value in self.conanfile.options[req].items():
71                 options[req][key] = value
72         return options
73
```
--- 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/conans/client/generators/json_generator.py b/conans/client/generators/json_generator.py
--- a/conans/client/generators/json_generator.py
+++ b/conans/client/generators/json_generator.py
@@ -13,7 +13,7 @@
         "libs",
         "system_libs",
         "defines", "cflags", "cxxflags", "sharedlinkflags", "exelinkflags",
-        "frameworks", "framework_paths"
+        "frameworks", "framework_paths", "names", "filenames"
     ]
     res = {}
     for key in keys:
diff --git a/conans/client/generators/markdown.py b/conans/client/generators/markdown.py
--- a/conans/client/generators/markdown.py
+++ b/conans/client/generators/markdown.py
@@ -53,18 +53,21 @@
 
 generator_cmake_find_package_tpl = textwrap.dedent("""
     ### Generator ``cmake_find_package``
+    {% set cmake_find_package_name = cpp_info.get_name("cmake_find_package") %}
+    {% set cmake_find_package_filename = cpp_info.get_filename("cmake_find_package") %}
+    Generates the file Find{{ cmake_find_package_filename }}.cmake
 
     Add these lines to your *CMakeLists.txt*:
 
     ```cmake
-    find_package({{ cpp_info.get_filename("cmake_find_package") }})
+    find_package({{ cmake_find_package_filename }})
 
     # Use the global target
-    target_link_libraries(<library_name> {{ cpp_info.get_name("cmake_find_package") }}::{{ cpp_info.get_name("cmake_find_package") }})
+    target_link_libraries(<library_name> {{ cmake_find_package_name }}::{{ cmake_find_package_name }})
     {% if cpp_info.components %}
     # Or link just one of its components
     {% for cmp_name, cmp_cpp_info in cpp_info.components.items() -%}
-    target_link_libraries(<library_name> {{ cpp_info.get_name("cmake_find_package") }}::{{ cmp_cpp_info.get_name("cmake_find_package") }})
+    target_link_libraries(<library_name> {{ cmake_find_package_name }}::{{ cmp_cpp_info.get_name("cmake_find_package") }})
     {% endfor %}
     {%- endif %}
     ```

{"golden_diff": "diff --git a/conans/client/generators/json_generator.py b/conans/client/generators/json_generator.py\n--- a/conans/client/generators/json_generator.py\n+++ b/conans/client/generators/json_generator.py\n@@ -13,7 +13,7 @@\n         \"libs\",\n         \"system_libs\",\n         \"defines\", \"cflags\", \"cxxflags\", \"sharedlinkflags\", \"exelinkflags\",\n-        \"frameworks\", \"framework_paths\"\n+        \"frameworks\", \"framework_paths\", \"names\", \"filenames\"\n     ]\n     res = {}\n     for key in keys:\ndiff --git a/conans/client/generators/markdown.py b/conans/client/generators/markdown.py\n--- a/conans/client/generators/markdown.py\n+++ b/conans/client/generators/markdown.py\n@@ -53,18 +53,21 @@\n \n generator_cmake_find_package_tpl = textwrap.dedent(\"\"\"\n     ### Generator ``cmake_find_package``\n+    {% set cmake_find_package_name = cpp_info.get_name(\"cmake_find_package\") %}\n+    {% set cmake_find_package_filename = cpp_info.get_filename(\"cmake_find_package\") %}\n+    Generates the file Find{{ cmake_find_package_filename }}.cmake\n \n     Add these lines to your *CMakeLists.txt*:\n \n     ```cmake\n-    find_package({{ cpp_info.get_filename(\"cmake_find_package\") }})\n+    find_package({{ cmake_find_package_filename }})\n \n     # Use the global target\n-    target_link_libraries(<library_name> {{ cpp_info.get_name(\"cmake_find_package\") }}::{{ cpp_info.get_name(\"cmake_find_package\") }})\n+    target_link_libraries(<library_name> {{ cmake_find_package_name }}::{{ cmake_find_package_name }})\n     {% if cpp_info.components %}\n     # Or link just one of its components\n     {% for cmp_name, cmp_cpp_info in cpp_info.components.items() -%}\n-    target_link_libraries(<library_name> {{ cpp_info.get_name(\"cmake_find_package\") }}::{{ cmp_cpp_info.get_name(\"cmake_find_package\") }})\n+    target_link_libraries(<library_name> {{ cmake_find_package_name }}::{{ cmp_cpp_info.get_name(\"cmake_find_package\") }})\n     {% endfor %}\n     {%- endif %}\n     ```\n", "issue": "[question] CLI command to discover the cmake_find_package filename from the Conan package name?\nThe `cmake_find_package` generator writes a Find Module file that defines a target in a namespace. Each of these three names (filename, namespace, target) are [configurable](https://github.com/conan-io/conan/issues/7254) in `cpp_info`. For example,\r\n\r\n```python\r\n        self.cpp_info.filename['cmake_find_package'] = 'BoostFile'\r\n        self.cpp_info.names['cmake_find_package'] = 'BoostNamespace'\r\n        self.cpp_info.name = 'BoostTarget'\r\n```\r\n\r\nwill generate a file named `FindBoostFile.cmake` that is used like this:\r\n\r\n```cmake\r\nfind_package(BoostFile)\r\ntarget_link_libraries(${target} BoostNamespace::BoostTarget)\r\n```\r\n\r\nIs there a CLI command that can print out these values given a package reference? Something like\r\n\r\n```\r\n$ conan inspect -a cpp_info.names.cmake_find_package boost/1.73.0@\r\n```\n", "before_files": [{"content": "import os\nimport textwrap\n\nfrom jinja2 import DictLoader\nfrom jinja2 import Environment\nfrom conans.model import Generator\nimport datetime\n\n\n\nrender_cpp_info = textwrap.dedent(\"\"\"\n    {% macro join_list_sources(items) -%}\n    ``{{ \"``, ``\".join(items) }}``\n    {%- endmacro %}\n\n    {% macro render_cpp_info(cpp_info) -%}\n    {%- if cpp_info.requires is iterable and cpp_info.requires %}\n    * Requires: {{ join_list_sources(cpp_info.requires) }}\n    {%- endif %}\n    {%- if cpp_info.libs %}\n    * Libraries: {{ join_list_sources(cpp_info.libs) }}\n    {%- endif %}\n    {%- if cpp_info.system_libs %}\n    * Systems libs: {{ join_list_sources(cpp_info.system_libs) }}\n    {%- endif %}\n    {%- if cpp_info.defines %}\n    * Preprocessor definitions: {{ join_list_sources(cpp_info.defines) }}\n    {%- endif %}\n    {%- if cpp_info.cflags %}\n    * C_FLAGS: {{ join_list_sources(cpp_info.cflags) }}\n    {%- endif %}\n    {%- if cpp_info.cxxflags %}\n    * CXX_FLAGS: {{ join_list_sources(cpp_info.cxxflags) }}\n    {%- endif %}\n    {%- if cpp_info.build_modules %}\n    * Build modules (see [below](#build-modules)): {{ join_list_sources(cpp_info.build_modules) }}\n    {%- endif %}\n    {%- endmacro %}\n\"\"\")\n\ngenerator_cmake_tpl = textwrap.dedent(\"\"\"\n    ### Generator ``cmake``\n\n    Add these lines to your *CMakeLists.txt*:\n\n    ```cmake\n    include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)\n    conan_basic_setup(TARGETS)\n\n    target_link_libraries(<library_name> CONAN_PKG::{{ cpp_info.get_name(\"cmake\") }})\n    ```\n\"\"\")\n\ngenerator_cmake_find_package_tpl = textwrap.dedent(\"\"\"\n    ### Generator ``cmake_find_package``\n\n    Add these lines to your *CMakeLists.txt*:\n\n    ```cmake\n    find_package({{ cpp_info.get_filename(\"cmake_find_package\") }})\n\n    # Use the global target\n    target_link_libraries(<library_name> {{ cpp_info.get_name(\"cmake_find_package\") }}::{{ cpp_info.get_name(\"cmake_find_package\") }})\n    {% if cpp_info.components %}\n    # Or link just one of its components\n    {% for cmp_name, cmp_cpp_info in cpp_info.components.items() -%}\n    target_link_libraries(<library_name> {{ cpp_info.get_name(\"cmake_find_package\") }}::{{ cmp_cpp_info.get_name(\"cmake_find_package\") }})\n    {% endfor %}\n    {%- endif %}\n    ```\n\n    Remember to adjust your build system settings to match the binaries you are linking with. You can\n    use the [CMake build helper](https://docs.conan.io/en/latest/reference/build_helpers/cmake.html) and\n    the ``cmake`` generator from a *conanfile.py* or the new [toolchain paradigm](https://docs.conan.io/en/latest/creating_packages/toolchains.html).\n\"\"\")\n\ngenerator_pkg_config_tpl = textwrap.dedent(\"\"\"\n    ### Generator ``pkg_config``\n\n    This package provides one *pkg-config* file ``{{ cpp_info.get_filename('pkg_config') }}.pc`` with\n    all the information from the library\n    {% if cpp_info.components -%}\n    and another file for each of its components:\n    {%- for cmp_name, cmp_cpp_info in cpp_info.components.items() -%}\n    ``{{ cmp_cpp_info.get_filename('pkg_config') }}.pc``{% if not loop.last %},{% endif %}\n    {%- endfor -%}\n    {%- endif -%}.\n    Use your *pkg-config* tool as usual to consume the information provided by the Conan package.\n\"\"\")\n\nrequirement_tpl = textwrap.dedent(\"\"\"\n    {% from 'render_cpp_info' import render_cpp_info %}\n\n    # {{ cpp_info.name }}/{{ cpp_info.version }}\n\n    ---\n    **Note.-** If this package belongs to ConanCenter, you can find more information [here](https://conan.io/center/{{ cpp_info.name }}/{{ cpp_info.version }}/).\n\n    ---\n\n    {% if requires or required_by %}\n    Graph of dependencies:\n    {% if requires %}\n    * ``{{ cpp_info.name }}`` requires:\n        {% for dep_name, dep_cpp_info in requires -%}\n        [{{ dep_name }}/{{ dep_cpp_info.version }}]({{ dep_name }}.md){% if not loop.last %}, {% endif %}\n        {%- endfor -%}\n    {%- endif %}\n    {%- if required_by %}\n    * ``{{ cpp_info.name }}`` is required by:\n        {%- for dep_name, dep_cpp_info in required_by %}\n        [{{ dep_name }}/{{ dep_cpp_info.version }}]({{ dep_name }}.md){% if not loop.last %}, {% endif %}\n        {%- endfor %}\n    {%- endif %}\n    {% endif %}\n\n    Information published by ``{{ cpp_info.name }}`` to consumers:\n\n    {%- if cpp_info.includedirs %}\n    * Headers (see [below](#header-files))\n    {%- endif %}\n    {% if cpp_info.components %}\n    {% for cmp_name, cmp_cpp_info in cpp_info.components.items() %}\n    * Component ``{{ cpp_info.name }}::{{ cmp_name }}``:\n    {{ render_cpp_info(cmp_cpp_info)|indent(width=2) }}\n    {%- endfor %}\n    {% else %}\n    {{ render_cpp_info(cpp_info)|indent(width=0) }}\n    {% endif %}\n\n\n    ## Generators\n\n    Read below how to use this package using different\n    [generators](https://docs.conan.io/en/latest/reference/generators.html). In order to use\n    these generators they have to be listed in the _conanfile.py_ file or using the command\n    line argument ``--generator/-g`` in the ``conan install`` command.\n\n\n    {% include 'generator_cmake' %}\n    {% include 'generator_cmake_find_package' %}\n    {% include 'generator_pkg_config_tpl' %}\n\n    ---\n    ## Header files\n\n    List of header files exposed by this package. Use them in your ``#include`` directives:\n\n    ```cpp\n    {%- for header in headers %}\n    {{ header }}\n    {%- endfor %}\n    ```\n\n    {%- if cpp_info.build_modules %}\n    ---\n    ## Build modules\n\n    Modules exported by this recipe. They are automatically included when using Conan generators:\n\n    {% for name, build_module in build_modules %}\n    **{{ name }}**\n    ```\n    {{ build_module }}\n    ```\n    {% endfor %}\n    {% endif %}\n\n    ---\n    ---\n    Conan **{{ conan_version }}**. JFrog LTD. [https://conan.io](https://conan.io). Autogenerated {{ now.strftime('%Y-%m-%d %H:%M:%S') }}.\n\"\"\")\n\n\nclass MarkdownGenerator(Generator):\n\n    def _list_headers(self, cpp_info):\n        rootpath = cpp_info.rootpath\n        for include_dir in cpp_info.includedirs:\n            for root, _, files in os.walk(os.path.join(cpp_info.rootpath, include_dir)):\n                for f in files:\n                    yield os.path.relpath(os.path.join(root, f), os.path.join(rootpath, include_dir))\n\n    def _list_requires(self, cpp_info):\n        return [(it, self.conanfile.deps_cpp_info[it]) for it in cpp_info.public_deps]\n\n    def _list_required_by(self, cpp_info):\n        for other_name, other_cpp_info in self.conanfile.deps_cpp_info.dependencies:\n            if cpp_info.name in other_cpp_info.public_deps:\n                yield other_name, other_cpp_info\n\n    def _read_build_modules(self, cpp_info):\n        for build_module in cpp_info.build_modules:\n            filename = os.path.join(cpp_info.rootpath, build_module)\n            yield build_module, open(filename, 'r').read()\n\n    @property\n    def filename(self):\n        pass\n\n    @property\n    def content(self):\n        dict_loader = DictLoader({\n            'render_cpp_info': render_cpp_info,\n            'package.md': requirement_tpl,\n            'generator_cmake': generator_cmake_tpl,\n            'generator_cmake_find_package': generator_cmake_find_package_tpl,\n            'generator_pkg_config_tpl': generator_pkg_config_tpl,\n        })\n        env = Environment(loader=dict_loader)\n        template = env.get_template('package.md')\n\n        from conans import __version__ as conan_version\n        ret = {}\n        for name, cpp_info in self.conanfile.deps_cpp_info.dependencies:\n            ret[\"{}.md\".format(name)] = template.render(\n                cpp_info=cpp_info,\n                headers=self._list_headers(cpp_info),\n                requires=list(self._list_requires(cpp_info)),\n                required_by=list(self._list_required_by(cpp_info)),\n                build_modules=self._read_build_modules(cpp_info),\n                conan_version=conan_version,\n                now=datetime.datetime.now()\n            )\n        return ret\n", "path": "conans/client/generators/markdown.py"}, {"content": "import json\n\nfrom conans.model import Generator\n\n\ndef serialize_cpp_info(cpp_info):\n    keys = [\n        \"version\",\n        \"description\",\n        \"rootpath\",\n        \"sysroot\",\n        \"include_paths\", \"lib_paths\", \"bin_paths\", \"build_paths\", \"res_paths\",\n        \"libs\",\n        \"system_libs\",\n        \"defines\", \"cflags\", \"cxxflags\", \"sharedlinkflags\", \"exelinkflags\",\n        \"frameworks\", \"framework_paths\"\n    ]\n    res = {}\n    for key in keys:\n        res[key] = getattr(cpp_info, key)\n    res[\"cppflags\"] = cpp_info.cxxflags  # Backwards compatibility\n    return res\n\n\ndef serialize_user_info(user_info):\n    res = {}\n    for key, value in user_info.items():\n        res[key] = value.vars\n    return res\n\n\nclass JsonGenerator(Generator):\n    @property\n    def filename(self):\n        return \"conanbuildinfo.json\"\n\n    @property\n    def content(self):\n        info = {}\n        info[\"deps_env_info\"] = self.deps_env_info.vars\n        info[\"deps_user_info\"] = serialize_user_info(self.deps_user_info)\n        info[\"dependencies\"] = self.get_dependencies_info()\n        info[\"settings\"] = self.get_settings()\n        info[\"options\"] = self.get_options()\n        if self._user_info_build:\n            info[\"user_info_build\"] = serialize_user_info(self._user_info_build)\n\n        return json.dumps(info, indent=2)\n\n    def get_dependencies_info(self):\n        res = []\n        for depname, cpp_info in self.deps_build_info.dependencies:\n            serialized_info = serialize_cpp_info(cpp_info)\n            serialized_info[\"name\"] = depname\n            for cfg, cfg_cpp_info in cpp_info.configs.items():\n                serialized_info.setdefault(\"configs\", {})[cfg] = serialize_cpp_info(cfg_cpp_info)\n            res.append(serialized_info)\n        return res\n\n    def get_settings(self):\n        settings = {}\n        for key, value in self.settings.items():\n            settings[key] = value\n        return settings\n\n    def get_options(self):\n        options = {}\n        for req in self.conanfile.requires:\n            options[req] = {}\n            for key, value in self.conanfile.options[req].items():\n                options[req][key] = value\n        return options\n", "path": "conans/client/generators/json_generator.py"}], "after_files": [{"content": "import os\nimport textwrap\n\nfrom jinja2 import DictLoader\nfrom jinja2 import Environment\nfrom conans.model import Generator\nimport datetime\n\n\n\nrender_cpp_info = textwrap.dedent(\"\"\"\n    {% macro join_list_sources(items) -%}\n    ``{{ \"``, ``\".join(items) }}``\n    {%- endmacro %}\n\n    {% macro render_cpp_info(cpp_info) -%}\n    {%- if cpp_info.requires is iterable and cpp_info.requires %}\n    * Requires: {{ join_list_sources(cpp_info.requires) }}\n    {%- endif %}\n    {%- if cpp_info.libs %}\n    * Libraries: {{ join_list_sources(cpp_info.libs) }}\n    {%- endif %}\n    {%- if cpp_info.system_libs %}\n    * Systems libs: {{ join_list_sources(cpp_info.system_libs) }}\n    {%- endif %}\n    {%- if cpp_info.defines %}\n    * Preprocessor definitions: {{ join_list_sources(cpp_info.defines) }}\n    {%- endif %}\n    {%- if cpp_info.cflags %}\n    * C_FLAGS: {{ join_list_sources(cpp_info.cflags) }}\n    {%- endif %}\n    {%- if cpp_info.cxxflags %}\n    * CXX_FLAGS: {{ join_list_sources(cpp_info.cxxflags) }}\n    {%- endif %}\n    {%- if cpp_info.build_modules %}\n    * Build modules (see [below](#build-modules)): {{ join_list_sources(cpp_info.build_modules) }}\n    {%- endif %}\n    {%- endmacro %}\n\"\"\")\n\ngenerator_cmake_tpl = textwrap.dedent(\"\"\"\n    ### Generator ``cmake``\n\n    Add these lines to your *CMakeLists.txt*:\n\n    ```cmake\n    include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)\n    conan_basic_setup(TARGETS)\n\n    target_link_libraries(<library_name> CONAN_PKG::{{ cpp_info.get_name(\"cmake\") }})\n    ```\n\"\"\")\n\ngenerator_cmake_find_package_tpl = textwrap.dedent(\"\"\"\n    ### Generator ``cmake_find_package``\n    {% set cmake_find_package_name = cpp_info.get_name(\"cmake_find_package\") %}\n    {% set cmake_find_package_filename = cpp_info.get_filename(\"cmake_find_package\") %}\n    Generates the file Find{{ cmake_find_package_filename }}.cmake\n\n    Add these lines to your *CMakeLists.txt*:\n\n    ```cmake\n    find_package({{ cmake_find_package_filename }})\n\n    # Use the global target\n    target_link_libraries(<library_name> {{ cmake_find_package_name }}::{{ cmake_find_package_name }})\n    {% if cpp_info.components %}\n    # Or link just one of its components\n    {% for cmp_name, cmp_cpp_info in cpp_info.components.items() -%}\n    target_link_libraries(<library_name> {{ cmake_find_package_name }}::{{ cmp_cpp_info.get_name(\"cmake_find_package\") }})\n    {% endfor %}\n    {%- endif %}\n    ```\n\n    Remember to adjust your build system settings to match the binaries you are linking with. You can\n    use the [CMake build helper](https://docs.conan.io/en/latest/reference/build_helpers/cmake.html) and\n    the ``cmake`` generator from a *conanfile.py* or the new [toolchain paradigm](https://docs.conan.io/en/latest/creating_packages/toolchains.html).\n\"\"\")\n\ngenerator_pkg_config_tpl = textwrap.dedent(\"\"\"\n    ### Generator ``pkg_config``\n\n    This package provides one *pkg-config* file ``{{ cpp_info.get_filename('pkg_config') }}.pc`` with\n    all the information from the library\n    {% if cpp_info.components -%}\n    and another file for each of its components:\n    {%- for cmp_name, cmp_cpp_info in cpp_info.components.items() -%}\n    ``{{ cmp_cpp_info.get_filename('pkg_config') }}.pc``{% if not loop.last %},{% endif %}\n    {%- endfor -%}\n    {%- endif -%}.\n    Use your *pkg-config* tool as usual to consume the information provided by the Conan package.\n\"\"\")\n\nrequirement_tpl = textwrap.dedent(\"\"\"\n    {% from 'render_cpp_info' import render_cpp_info %}\n\n    # {{ cpp_info.name }}/{{ cpp_info.version }}\n\n    ---\n    **Note.-** If this package belongs to ConanCenter, you can find more information [here](https://conan.io/center/{{ cpp_info.name }}/{{ cpp_info.version }}/).\n\n    ---\n\n    {% if requires or required_by %}\n    Graph of dependencies:\n    {% if requires %}\n    * ``{{ cpp_info.name }}`` requires:\n        {% for dep_name, dep_cpp_info in requires -%}\n        [{{ dep_name }}/{{ dep_cpp_info.version }}]({{ dep_name }}.md){% if not loop.last %}, {% endif %}\n        {%- endfor -%}\n    {%- endif %}\n    {%- if required_by %}\n    * ``{{ cpp_info.name }}`` is required by:\n        {%- for dep_name, dep_cpp_info in required_by %}\n        [{{ dep_name }}/{{ dep_cpp_info.version }}]({{ dep_name }}.md){% if not loop.last %}, {% endif %}\n        {%- endfor %}\n    {%- endif %}\n    {% endif %}\n\n    Information published by ``{{ cpp_info.name }}`` to consumers:\n\n    {%- if cpp_info.includedirs %}\n    * Headers (see [below](#header-files))\n    {%- endif %}\n    {% if cpp_info.components %}\n    {% for cmp_name, cmp_cpp_info in cpp_info.components.items() %}\n    * Component ``{{ cpp_info.name }}::{{ cmp_name }}``:\n    {{ render_cpp_info(cmp_cpp_info)|indent(width=2) }}\n    {%- endfor %}\n    {% else %}\n    {{ render_cpp_info(cpp_info)|indent(width=0) }}\n    {% endif %}\n\n\n    ## Generators\n\n    Read below how to use this package using different\n    [generators](https://docs.conan.io/en/latest/reference/generators.html). In order to use\n    these generators they have to be listed in the _conanfile.py_ file or using the command\n    line argument ``--generator/-g`` in the ``conan install`` command.\n\n\n    {% include 'generator_cmake' %}\n    {% include 'generator_cmake_find_package' %}\n    {% include 'generator_pkg_config_tpl' %}\n\n    ---\n    ## Header files\n\n    List of header files exposed by this package. Use them in your ``#include`` directives:\n\n    ```cpp\n    {%- for header in headers %}\n    {{ header }}\n    {%- endfor %}\n    ```\n\n    {%- if cpp_info.build_modules %}\n    ---\n    ## Build modules\n\n    Modules exported by this recipe. They are automatically included when using Conan generators:\n\n    {% for name, build_module in build_modules %}\n    **{{ name }}**\n    ```\n    {{ build_module }}\n    ```\n    {% endfor %}\n    {% endif %}\n\n    ---\n    ---\n    Conan **{{ conan_version }}**. JFrog LTD. [https://conan.io](https://conan.io). Autogenerated {{ now.strftime('%Y-%m-%d %H:%M:%S') }}.\n\"\"\")\n\n\nclass MarkdownGenerator(Generator):\n\n    def _list_headers(self, cpp_info):\n        rootpath = cpp_info.rootpath\n        for include_dir in cpp_info.includedirs:\n            for root, _, files in os.walk(os.path.join(cpp_info.rootpath, include_dir)):\n                for f in files:\n                    yield os.path.relpath(os.path.join(root, f), os.path.join(rootpath, include_dir))\n\n    def _list_requires(self, cpp_info):\n        return [(it, self.conanfile.deps_cpp_info[it]) for it in cpp_info.public_deps]\n\n    def _list_required_by(self, cpp_info):\n        for other_name, other_cpp_info in self.conanfile.deps_cpp_info.dependencies:\n            if cpp_info.name in other_cpp_info.public_deps:\n                yield other_name, other_cpp_info\n\n    def _read_build_modules(self, cpp_info):\n        for build_module in cpp_info.build_modules:\n            filename = os.path.join(cpp_info.rootpath, build_module)\n            yield build_module, open(filename, 'r').read()\n\n    @property\n    def filename(self):\n        pass\n\n    @property\n    def content(self):\n        dict_loader = DictLoader({\n            'render_cpp_info': render_cpp_info,\n            'package.md': requirement_tpl,\n            'generator_cmake': generator_cmake_tpl,\n            'generator_cmake_find_package': generator_cmake_find_package_tpl,\n            'generator_pkg_config_tpl': generator_pkg_config_tpl,\n        })\n        env = Environment(loader=dict_loader)\n        template = env.get_template('package.md')\n\n        from conans import __version__ as conan_version\n        ret = {}\n        for name, cpp_info in self.conanfile.deps_cpp_info.dependencies:\n            ret[\"{}.md\".format(name)] = template.render(\n                cpp_info=cpp_info,\n                headers=self._list_headers(cpp_info),\n                requires=list(self._list_requires(cpp_info)),\n                required_by=list(self._list_required_by(cpp_info)),\n                build_modules=self._read_build_modules(cpp_info),\n                conan_version=conan_version,\n                now=datetime.datetime.now()\n            )\n        return ret\n", "path": "conans/client/generators/markdown.py"}, {"content": "import json\n\nfrom conans.model import Generator\n\n\ndef serialize_cpp_info(cpp_info):\n    keys = [\n        \"version\",\n        \"description\",\n        \"rootpath\",\n        \"sysroot\",\n        \"include_paths\", \"lib_paths\", \"bin_paths\", \"build_paths\", \"res_paths\",\n        \"libs\",\n        \"system_libs\",\n        \"defines\", \"cflags\", \"cxxflags\", \"sharedlinkflags\", \"exelinkflags\",\n        \"frameworks\", \"framework_paths\", \"names\", \"filenames\"\n    ]\n    res = {}\n    for key in keys:\n        res[key] = getattr(cpp_info, key)\n    res[\"cppflags\"] = cpp_info.cxxflags  # Backwards compatibility\n    return res\n\n\ndef serialize_user_info(user_info):\n    res = {}\n    for key, value in user_info.items():\n        res[key] = value.vars\n    return res\n\n\nclass JsonGenerator(Generator):\n    @property\n    def filename(self):\n        return \"conanbuildinfo.json\"\n\n    @property\n    def content(self):\n        info = {}\n        info[\"deps_env_info\"] = self.deps_env_info.vars\n        info[\"deps_user_info\"] = serialize_user_info(self.deps_user_info)\n        info[\"dependencies\"] = self.get_dependencies_info()\n        info[\"settings\"] = self.get_settings()\n        info[\"options\"] = self.get_options()\n        if self._user_info_build:\n            info[\"user_info_build\"] = serialize_user_info(self._user_info_build)\n\n        return json.dumps(info, indent=2)\n\n    def get_dependencies_info(self):\n        res = []\n        for depname, cpp_info in self.deps_build_info.dependencies:\n            serialized_info = serialize_cpp_info(cpp_info)\n            serialized_info[\"name\"] = depname\n            for cfg, cfg_cpp_info in cpp_info.configs.items():\n                serialized_info.setdefault(\"configs\", {})[cfg] = serialize_cpp_info(cfg_cpp_info)\n            res.append(serialized_info)\n        return res\n\n    def get_settings(self):\n        settings = {}\n        for key, value in self.settings.items():\n            settings[key] = value\n        return settings\n\n    def get_options(self):\n        options = {}\n        for req in self.conanfile.requires:\n            options[req] = {}\n            for key, value in self.conanfile.options[req].items():\n                options[req][key] = value\n        return options\n", "path": "conans/client/generators/json_generator.py"}]}