We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[bug] CMakeDeps generator: component and package with the same name
Hi!

During refactoring #8971 behavior of `tvalue` [macro](https://github.com/conan-io/conan/blob/80e99ca9a7d730e95adbc8bde5aa33da4f4fbb44/conan/tools/cmake/cmakedeps/templates/target_configuration.py#L35) was changed by adding some special case when `pkg_name` and `comp_name` are the same. 

It accidentally break this case, because `tvalue` macro is inlined in declaration of several variables (see [this](https://github.com/conan-io/conan/blob/80e99ca9a7d730e95adbc8bde5aa33da4f4fbb44/conan/tools/cmake/cmakedeps/templates/target_configuration.py#L98) for example). So these variables have one name (`{pkg_name}_{comp_name}_...`) during setting and the other name (`{comp_name}_...`) during using it in `set_property`.

cc @lasote 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `conan/tools/cmake/cmakedeps/templates/target_configuration.py`
Content:
```
1 import textwrap
2 
3 from conan.tools.cmake.cmakedeps.templates import CMakeDepsFileTemplate, get_component_alias, \
4     get_target_namespace
5 
6 """
7 
8 FooTarget-release.cmake
9 
10 """
11 
12 
13 class TargetConfigurationTemplate(CMakeDepsFileTemplate):
14 
15     @property
16     def filename(self):
17         return "{}Target-{}.cmake".format(self.file_name,
18                                             self.cmakedeps.configuration.lower())
19 
20     @property
21     def context(self):
22         deps_targets_names = self.get_deps_targets_names() \
23             if not self.conanfile.is_build_context else []
24         return {"pkg_name": self.pkg_name,
25                 "target_namespace": self.target_namespace,
26                 "config_suffix": self.config_suffix,
27                 "deps_targets_names": ";".join(deps_targets_names),
28                 "components_names":  self.get_required_components_names(),
29                 "configuration": self.cmakedeps.configuration}
30 
31     @property
32     def template(self):
33         return textwrap.dedent("""\
34 
35         {%- macro tvalue(pkg_name, comp_name, var, config_suffix) -%}
36             {%- if comp_name == pkg_name -%}
37                 {{'${'+pkg_name+'_'+var+config_suffix+'}'}}
38             {%- else -%}
39                 {{'${'+pkg_name+'_'+comp_name+'_'+var+config_suffix+'}'}}
40             {%- endif -%}
41         {%- endmacro -%}
42 
43         ########### VARIABLES #######################################################################
44         #############################################################################################
45 
46         set({{ pkg_name }}_COMPILE_OPTIONS{{ config_suffix }}
47             "$<$<COMPILE_LANGUAGE:CXX>{{ ':${' }}{{ pkg_name }}_COMPILE_OPTIONS_CXX{{ config_suffix }}}>"
48             "$<$<COMPILE_LANGUAGE:C>{{ ':${' }}{{ pkg_name }}_COMPILE_OPTIONS_C{{ config_suffix }}}>")
49 
50         set({{ pkg_name }}_LINKER_FLAGS{{ config_suffix }}
51             "$<$<STREQUAL{{ ':$' }}<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>{{ ':${' }}{{ pkg_name }}_SHARED_LINK_FLAGS{{ config_suffix }}}>"
52             "$<$<STREQUAL{{ ':$' }}<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>{{ ':${' }}{{ pkg_name }}_SHARED_LINK_FLAGS{{ config_suffix }}}>"
53             "$<$<STREQUAL{{ ':$' }}<TARGET_PROPERTY:TYPE>,EXECUTABLE>{{ ':${' }}{{ pkg_name }}_EXE_LINK_FLAGS{{ config_suffix }}}>")
54 
55         set({{ pkg_name }}_FRAMEWORKS_FOUND{{ config_suffix }} "") # Will be filled later
56         conan_find_apple_frameworks({{ pkg_name }}_FRAMEWORKS_FOUND{{ config_suffix }} "{{ '${' }}{{ pkg_name }}_FRAMEWORKS{{ config_suffix }}}" "{{ '${' }}{{ pkg_name }}_FRAMEWORK_DIRS{{ config_suffix }}}")
57 
58         # Gather all the libraries that should be linked to the targets (do not touch existing variables)
59         set(_{{ pkg_name }}_DEPENDENCIES{{ config_suffix }} "{{ '${' }}{{ pkg_name }}_FRAMEWORKS_FOUND{{ config_suffix }}} {{ '${' }}{{ pkg_name }}_SYSTEM_LIBS{{ config_suffix }}} {{ deps_targets_names }}")
60 
61         set({{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }} "") # Will be filled later
62         set({{ pkg_name }}_LIBRARIES{{ config_suffix }} "") # Will be filled later
63         conan_package_library_targets("{{ '${' }}{{ pkg_name }}_LIBS{{ config_suffix }}}"    # libraries
64                                       "{{ '${' }}{{ pkg_name }}_LIB_DIRS{{ config_suffix }}}" # package_libdir
65                                       "{{ '${' }}_{{ pkg_name }}_DEPENDENCIES{{ config_suffix }}}" # deps
66                                       {{ pkg_name }}_LIBRARIES{{ config_suffix }}   # out_libraries
67                                       {{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }}  # out_libraries_targets
68                                       "{{ config_suffix }}"  # config_suffix
69                                       "{{ pkg_name }}")    # package_name
70 
71         foreach(_FRAMEWORK {{ '${' }}{{ pkg_name }}_FRAMEWORKS_FOUND{{ config_suffix }}})
72             list(APPEND {{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }} ${_FRAMEWORK})
73             list(APPEND {{ pkg_name }}_LIBRARIES{{ config_suffix }} ${_FRAMEWORK})
74         endforeach()
75 
76         foreach(_SYSTEM_LIB {{ '${' }}{{ pkg_name }}_SYSTEM_LIBS{{ config_suffix }}})
77             list(APPEND {{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }} ${_SYSTEM_LIB})
78             list(APPEND {{ pkg_name }}_LIBRARIES{{ config_suffix }} ${_SYSTEM_LIB})
79         endforeach()
80 
81         # We need to add our requirements too
82         set({{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }} {{ '"${' }}{{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }}{{ '};' }}{{ deps_targets_names }}")
83         set({{ pkg_name }}_LIBRARIES{{ config_suffix }} {{ '"${' }}{{ pkg_name }}_LIBRARIES{{ config_suffix }}{{ '};' }}{{ deps_targets_names }}")
84 
85         # FIXME: What is the result of this for multi-config? All configs adding themselves to path?
86         set(CMAKE_MODULE_PATH {{ '${' }}{{ pkg_name }}_BUILD_DIRS{{ config_suffix }}} {{ '${' }}CMAKE_MODULE_PATH})
87         set(CMAKE_PREFIX_PATH {{ '${' }}{{ pkg_name }}_BUILD_DIRS{{ config_suffix }}} {{ '${' }}CMAKE_PREFIX_PATH})
88 
89         {%- for comp_name in components_names %}
90 
91         ########## COMPONENT {{ comp_name }} FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #############
92 
93         set({{ pkg_name }}_{{ comp_name }}_FRAMEWORKS_FOUND{{ config_suffix }} "")
94         conan_find_apple_frameworks({{ pkg_name }}_{{ comp_name }}_FRAMEWORKS_FOUND{{ config_suffix }} "{{ '${'+pkg_name+'_'+comp_name+'_FRAMEWORKS'+config_suffix+'}' }}" "{{ '${'+pkg_name+'_'+comp_name+'_FRAMEWORK_DIRS'+config_suffix+'}' }}")
95 
96         set({{ pkg_name }}_{{ comp_name }}_LIB_TARGETS{{ config_suffix }} "")
97         set({{ pkg_name }}_{{ comp_name }}_NOT_USED{{ config_suffix }} "")
98         set({{ pkg_name }}_{{ comp_name }}_LIBS_FRAMEWORKS_DEPS{{ config_suffix }} {{ '${'+pkg_name+'_'+comp_name+'_FRAMEWORKS_FOUND'+config_suffix+'}' }} {{ '${'+pkg_name+'_'+comp_name+'_SYSTEM_LIBS'+config_suffix+'}' }} {{ '${'+pkg_name+'_'+comp_name+'_DEPENDENCIES'+config_suffix+'}' }})
99         conan_package_library_targets("{{ '${'+pkg_name+'_'+comp_name+'_LIBS'+config_suffix+'}' }}"
100                                       "{{ '${'+pkg_name+'_'+comp_name+'_LIB_DIRS'+config_suffix+'}' }}"
101                                       "{{ '${'+pkg_name+'_'+comp_name+'_LIBS_FRAMEWORKS_DEPS'+config_suffix+'}' }}"
102                                       {{ pkg_name }}_{{ comp_name }}_NOT_USED{{ config_suffix }}
103                                       {{ pkg_name }}_{{ comp_name }}_LIB_TARGETS{{ config_suffix }}
104                                       "{{ config_suffix }}"
105                                       "{{ pkg_name }}_{{ comp_name }}")
106 
107         set({{ pkg_name }}_{{ comp_name }}_LINK_LIBS{{ config_suffix }} {{ '${'+pkg_name+'_'+comp_name+'_LIB_TARGETS'+config_suffix+'}' }} {{ '${'+pkg_name+'_'+comp_name+'_LIBS_FRAMEWORKS_DEPS'+config_suffix+'}' }})
108         {%- endfor %}
109 
110 
111 
112         ########## GLOBAL TARGET PROPERTIES {{ configuration }} ########################################
113         set_property(TARGET {{target_namespace}}::{{target_namespace}}
114                      PROPERTY INTERFACE_LINK_LIBRARIES
115                      $<$<CONFIG:{{configuration}}>:${{'{'}}{{pkg_name}}_LIBRARIES_TARGETS{{config_suffix}}}
116                                                    ${{'{'}}{{pkg_name}}_LINKER_FLAGS{{config_suffix}}}> APPEND)
117         set_property(TARGET {{target_namespace}}::{{target_namespace}}
118                      PROPERTY INTERFACE_INCLUDE_DIRECTORIES
119                      $<$<CONFIG:{{configuration}}>:${{'{'}}{{pkg_name}}_INCLUDE_DIRS{{config_suffix}}}> APPEND)
120         set_property(TARGET {{target_namespace}}::{{target_namespace}}
121                      PROPERTY INTERFACE_COMPILE_DEFINITIONS
122                      $<$<CONFIG:{{configuration}}>:${{'{'}}{{pkg_name}}_COMPILE_DEFINITIONS{{config_suffix}}}> APPEND)
123         set_property(TARGET {{target_namespace}}::{{target_namespace}}
124                      PROPERTY INTERFACE_COMPILE_OPTIONS
125                      $<$<CONFIG:{{configuration}}>:${{'{'}}{{pkg_name}}_COMPILE_OPTIONS{{config_suffix}}}> APPEND)
126 
127         ########## COMPONENTS TARGET PROPERTIES {{ configuration }} ########################################
128 
129         {%- for comp_name in components_names %}
130 
131         ########## COMPONENT {{ comp_name }} TARGET PROPERTIES ######################################
132         set_property(TARGET {{ target_namespace }}::{{ comp_name }} PROPERTY INTERFACE_LINK_LIBRARIES
133                      $<$<CONFIG:{{ configuration }}>:{{tvalue(pkg_name, comp_name, 'LINK_LIBS', config_suffix)}}
134                      {{tvalue(pkg_name, comp_name, 'LINKER_FLAGS', config_suffix)}}> APPEND)
135         set_property(TARGET {{ target_namespace }}::{{ comp_name }} PROPERTY INTERFACE_INCLUDE_DIRECTORIES
136                      $<$<CONFIG:{{ configuration }}>:{{tvalue(pkg_name, comp_name, 'INCLUDE_DIRS', config_suffix)}}> APPEND)
137         set_property(TARGET {{ target_namespace }}::{{ comp_name }} PROPERTY INTERFACE_COMPILE_DEFINITIONS
138                      $<$<CONFIG:{{ configuration }}>:{{tvalue(pkg_name, comp_name, 'COMPILE_DEFINITIONS', config_suffix)}}> APPEND)
139         set_property(TARGET {{ target_namespace }}::{{ comp_name }} PROPERTY INTERFACE_COMPILE_OPTIONS
140                      $<$<CONFIG:{{ configuration }}>:
141                      {{tvalue(pkg_name, comp_name, 'COMPILE_OPTIONS_C', config_suffix)}}
142                      {{tvalue(pkg_name, comp_name, 'COMPILE_OPTIONS_CXX', config_suffix)}}> APPEND)
143         set({{ pkg_name }}_{{ comp_name }}_TARGET_PROPERTIES TRUE)
144 
145         {%- endfor %}
146 
147         """)
148 
149     def get_required_components_names(self):
150         """Returns a list of component_name"""
151         ret = []
152         sorted_comps = self.conanfile.new_cpp_info.get_sorted_components()
153         for comp_name, comp in sorted_comps.items():
154             ret.append(get_component_alias(self.conanfile, comp_name))
155         ret.reverse()
156         return ret
157 
158     def get_deps_targets_names(self):
159         """
160           - [{foo}::{bar}, ] of the required
161         """
162         ret = []
163 
164         # Get a list of dependencies target names
165         # Declared cppinfo.requires or .components[].requires
166         if self.conanfile.new_cpp_info.required_components:
167             for dep_name, component_name in self.conanfile.new_cpp_info.required_components:
168                 if not dep_name:
169                     # Internal dep (no another component)
170                     dep_name = get_target_namespace(self.conanfile)
171                     req = self.conanfile
172                 else:
173                     req = self.conanfile.dependencies.transitive_host_requires[dep_name]
174                     dep_name = get_target_namespace(req)
175 
176                 component_name = get_component_alias(req, component_name)
177                 ret.append("{}::{}".format(dep_name, component_name))
178         elif self.conanfile.dependencies.host_requires:
179             # Regular external "conanfile.requires" declared, not cpp_info requires
180             ret = ["{p}::{p}".format(p=get_target_namespace(r))
181                                      for r in self.conanfile.dependencies.host_requires]
182         return ret
183
```
--- 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/conan/tools/cmake/cmakedeps/templates/target_configuration.py b/conan/tools/cmake/cmakedeps/templates/target_configuration.py
--- a/conan/tools/cmake/cmakedeps/templates/target_configuration.py
+++ b/conan/tools/cmake/cmakedeps/templates/target_configuration.py
@@ -33,11 +33,7 @@
         return textwrap.dedent("""\
 
         {%- macro tvalue(pkg_name, comp_name, var, config_suffix) -%}
-            {%- if comp_name == pkg_name -%}
-                {{'${'+pkg_name+'_'+var+config_suffix+'}'}}
-            {%- else -%}
-                {{'${'+pkg_name+'_'+comp_name+'_'+var+config_suffix+'}'}}
-            {%- endif -%}
+            {{'${'+pkg_name+'_'+comp_name+'_'+var+config_suffix+'}'}}
         {%- endmacro -%}
 
         ########### VARIABLES #######################################################################

{"golden_diff": "diff --git a/conan/tools/cmake/cmakedeps/templates/target_configuration.py b/conan/tools/cmake/cmakedeps/templates/target_configuration.py\n--- a/conan/tools/cmake/cmakedeps/templates/target_configuration.py\n+++ b/conan/tools/cmake/cmakedeps/templates/target_configuration.py\n@@ -33,11 +33,7 @@\n         return textwrap.dedent(\"\"\"\\\n \n         {%- macro tvalue(pkg_name, comp_name, var, config_suffix) -%}\n-            {%- if comp_name == pkg_name -%}\n-                {{'${'+pkg_name+'_'+var+config_suffix+'}'}}\n-            {%- else -%}\n-                {{'${'+pkg_name+'_'+comp_name+'_'+var+config_suffix+'}'}}\n-            {%- endif -%}\n+            {{'${'+pkg_name+'_'+comp_name+'_'+var+config_suffix+'}'}}\n         {%- endmacro -%}\n \n         ########### VARIABLES #######################################################################\n", "issue": "[bug] CMakeDeps generator: component and package with the same name\nHi!\r\n\r\nDuring refactoring #8971 behavior of `tvalue` [macro](https://github.com/conan-io/conan/blob/80e99ca9a7d730e95adbc8bde5aa33da4f4fbb44/conan/tools/cmake/cmakedeps/templates/target_configuration.py#L35) was changed by adding some special case when `pkg_name` and `comp_name` are the same. \r\n\r\nIt accidentally break this case, because `tvalue` macro is inlined in declaration of several variables (see [this](https://github.com/conan-io/conan/blob/80e99ca9a7d730e95adbc8bde5aa33da4f4fbb44/conan/tools/cmake/cmakedeps/templates/target_configuration.py#L98) for example). So these variables have one name (`{pkg_name}_{comp_name}_...`) during setting and the other name (`{comp_name}_...`) during using it in `set_property`.\r\n\r\ncc @lasote \n", "before_files": [{"content": "import textwrap\n\nfrom conan.tools.cmake.cmakedeps.templates import CMakeDepsFileTemplate, get_component_alias, \\\n    get_target_namespace\n\n\"\"\"\n\nFooTarget-release.cmake\n\n\"\"\"\n\n\nclass TargetConfigurationTemplate(CMakeDepsFileTemplate):\n\n    @property\n    def filename(self):\n        return \"{}Target-{}.cmake\".format(self.file_name,\n                                            self.cmakedeps.configuration.lower())\n\n    @property\n    def context(self):\n        deps_targets_names = self.get_deps_targets_names() \\\n            if not self.conanfile.is_build_context else []\n        return {\"pkg_name\": self.pkg_name,\n                \"target_namespace\": self.target_namespace,\n                \"config_suffix\": self.config_suffix,\n                \"deps_targets_names\": \";\".join(deps_targets_names),\n                \"components_names\":  self.get_required_components_names(),\n                \"configuration\": self.cmakedeps.configuration}\n\n    @property\n    def template(self):\n        return textwrap.dedent(\"\"\"\\\n\n        {%- macro tvalue(pkg_name, comp_name, var, config_suffix) -%}\n            {%- if comp_name == pkg_name -%}\n                {{'${'+pkg_name+'_'+var+config_suffix+'}'}}\n            {%- else -%}\n                {{'${'+pkg_name+'_'+comp_name+'_'+var+config_suffix+'}'}}\n            {%- endif -%}\n        {%- endmacro -%}\n\n        ########### VARIABLES #######################################################################\n        #############################################################################################\n\n        set({{ pkg_name }}_COMPILE_OPTIONS{{ config_suffix }}\n            \"$<$<COMPILE_LANGUAGE:CXX>{{ ':${' }}{{ pkg_name }}_COMPILE_OPTIONS_CXX{{ config_suffix }}}>\"\n            \"$<$<COMPILE_LANGUAGE:C>{{ ':${' }}{{ pkg_name }}_COMPILE_OPTIONS_C{{ config_suffix }}}>\")\n\n        set({{ pkg_name }}_LINKER_FLAGS{{ config_suffix }}\n            \"$<$<STREQUAL{{ ':$' }}<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>{{ ':${' }}{{ pkg_name }}_SHARED_LINK_FLAGS{{ config_suffix }}}>\"\n            \"$<$<STREQUAL{{ ':$' }}<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>{{ ':${' }}{{ pkg_name }}_SHARED_LINK_FLAGS{{ config_suffix }}}>\"\n            \"$<$<STREQUAL{{ ':$' }}<TARGET_PROPERTY:TYPE>,EXECUTABLE>{{ ':${' }}{{ pkg_name }}_EXE_LINK_FLAGS{{ config_suffix }}}>\")\n\n        set({{ pkg_name }}_FRAMEWORKS_FOUND{{ config_suffix }} \"\") # Will be filled later\n        conan_find_apple_frameworks({{ pkg_name }}_FRAMEWORKS_FOUND{{ config_suffix }} \"{{ '${' }}{{ pkg_name }}_FRAMEWORKS{{ config_suffix }}}\" \"{{ '${' }}{{ pkg_name }}_FRAMEWORK_DIRS{{ config_suffix }}}\")\n\n        # Gather all the libraries that should be linked to the targets (do not touch existing variables)\n        set(_{{ pkg_name }}_DEPENDENCIES{{ config_suffix }} \"{{ '${' }}{{ pkg_name }}_FRAMEWORKS_FOUND{{ config_suffix }}} {{ '${' }}{{ pkg_name }}_SYSTEM_LIBS{{ config_suffix }}} {{ deps_targets_names }}\")\n\n        set({{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }} \"\") # Will be filled later\n        set({{ pkg_name }}_LIBRARIES{{ config_suffix }} \"\") # Will be filled later\n        conan_package_library_targets(\"{{ '${' }}{{ pkg_name }}_LIBS{{ config_suffix }}}\"    # libraries\n                                      \"{{ '${' }}{{ pkg_name }}_LIB_DIRS{{ config_suffix }}}\" # package_libdir\n                                      \"{{ '${' }}_{{ pkg_name }}_DEPENDENCIES{{ config_suffix }}}\" # deps\n                                      {{ pkg_name }}_LIBRARIES{{ config_suffix }}   # out_libraries\n                                      {{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }}  # out_libraries_targets\n                                      \"{{ config_suffix }}\"  # config_suffix\n                                      \"{{ pkg_name }}\")    # package_name\n\n        foreach(_FRAMEWORK {{ '${' }}{{ pkg_name }}_FRAMEWORKS_FOUND{{ config_suffix }}})\n            list(APPEND {{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }} ${_FRAMEWORK})\n            list(APPEND {{ pkg_name }}_LIBRARIES{{ config_suffix }} ${_FRAMEWORK})\n        endforeach()\n\n        foreach(_SYSTEM_LIB {{ '${' }}{{ pkg_name }}_SYSTEM_LIBS{{ config_suffix }}})\n            list(APPEND {{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }} ${_SYSTEM_LIB})\n            list(APPEND {{ pkg_name }}_LIBRARIES{{ config_suffix }} ${_SYSTEM_LIB})\n        endforeach()\n\n        # We need to add our requirements too\n        set({{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }} {{ '\"${' }}{{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }}{{ '};' }}{{ deps_targets_names }}\")\n        set({{ pkg_name }}_LIBRARIES{{ config_suffix }} {{ '\"${' }}{{ pkg_name }}_LIBRARIES{{ config_suffix }}{{ '};' }}{{ deps_targets_names }}\")\n\n        # FIXME: What is the result of this for multi-config? All configs adding themselves to path?\n        set(CMAKE_MODULE_PATH {{ '${' }}{{ pkg_name }}_BUILD_DIRS{{ config_suffix }}} {{ '${' }}CMAKE_MODULE_PATH})\n        set(CMAKE_PREFIX_PATH {{ '${' }}{{ pkg_name }}_BUILD_DIRS{{ config_suffix }}} {{ '${' }}CMAKE_PREFIX_PATH})\n\n        {%- for comp_name in components_names %}\n\n        ########## COMPONENT {{ comp_name }} FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #############\n\n        set({{ pkg_name }}_{{ comp_name }}_FRAMEWORKS_FOUND{{ config_suffix }} \"\")\n        conan_find_apple_frameworks({{ pkg_name }}_{{ comp_name }}_FRAMEWORKS_FOUND{{ config_suffix }} \"{{ '${'+pkg_name+'_'+comp_name+'_FRAMEWORKS'+config_suffix+'}' }}\" \"{{ '${'+pkg_name+'_'+comp_name+'_FRAMEWORK_DIRS'+config_suffix+'}' }}\")\n\n        set({{ pkg_name }}_{{ comp_name }}_LIB_TARGETS{{ config_suffix }} \"\")\n        set({{ pkg_name }}_{{ comp_name }}_NOT_USED{{ config_suffix }} \"\")\n        set({{ pkg_name }}_{{ comp_name }}_LIBS_FRAMEWORKS_DEPS{{ config_suffix }} {{ '${'+pkg_name+'_'+comp_name+'_FRAMEWORKS_FOUND'+config_suffix+'}' }} {{ '${'+pkg_name+'_'+comp_name+'_SYSTEM_LIBS'+config_suffix+'}' }} {{ '${'+pkg_name+'_'+comp_name+'_DEPENDENCIES'+config_suffix+'}' }})\n        conan_package_library_targets(\"{{ '${'+pkg_name+'_'+comp_name+'_LIBS'+config_suffix+'}' }}\"\n                                      \"{{ '${'+pkg_name+'_'+comp_name+'_LIB_DIRS'+config_suffix+'}' }}\"\n                                      \"{{ '${'+pkg_name+'_'+comp_name+'_LIBS_FRAMEWORKS_DEPS'+config_suffix+'}' }}\"\n                                      {{ pkg_name }}_{{ comp_name }}_NOT_USED{{ config_suffix }}\n                                      {{ pkg_name }}_{{ comp_name }}_LIB_TARGETS{{ config_suffix }}\n                                      \"{{ config_suffix }}\"\n                                      \"{{ pkg_name }}_{{ comp_name }}\")\n\n        set({{ pkg_name }}_{{ comp_name }}_LINK_LIBS{{ config_suffix }} {{ '${'+pkg_name+'_'+comp_name+'_LIB_TARGETS'+config_suffix+'}' }} {{ '${'+pkg_name+'_'+comp_name+'_LIBS_FRAMEWORKS_DEPS'+config_suffix+'}' }})\n        {%- endfor %}\n\n\n\n        ########## GLOBAL TARGET PROPERTIES {{ configuration }} ########################################\n        set_property(TARGET {{target_namespace}}::{{target_namespace}}\n                     PROPERTY INTERFACE_LINK_LIBRARIES\n                     $<$<CONFIG:{{configuration}}>:${{'{'}}{{pkg_name}}_LIBRARIES_TARGETS{{config_suffix}}}\n                                                   ${{'{'}}{{pkg_name}}_LINKER_FLAGS{{config_suffix}}}> APPEND)\n        set_property(TARGET {{target_namespace}}::{{target_namespace}}\n                     PROPERTY INTERFACE_INCLUDE_DIRECTORIES\n                     $<$<CONFIG:{{configuration}}>:${{'{'}}{{pkg_name}}_INCLUDE_DIRS{{config_suffix}}}> APPEND)\n        set_property(TARGET {{target_namespace}}::{{target_namespace}}\n                     PROPERTY INTERFACE_COMPILE_DEFINITIONS\n                     $<$<CONFIG:{{configuration}}>:${{'{'}}{{pkg_name}}_COMPILE_DEFINITIONS{{config_suffix}}}> APPEND)\n        set_property(TARGET {{target_namespace}}::{{target_namespace}}\n                     PROPERTY INTERFACE_COMPILE_OPTIONS\n                     $<$<CONFIG:{{configuration}}>:${{'{'}}{{pkg_name}}_COMPILE_OPTIONS{{config_suffix}}}> APPEND)\n\n        ########## COMPONENTS TARGET PROPERTIES {{ configuration }} ########################################\n\n        {%- for comp_name in components_names %}\n\n        ########## COMPONENT {{ comp_name }} TARGET PROPERTIES ######################################\n        set_property(TARGET {{ target_namespace }}::{{ comp_name }} PROPERTY INTERFACE_LINK_LIBRARIES\n                     $<$<CONFIG:{{ configuration }}>:{{tvalue(pkg_name, comp_name, 'LINK_LIBS', config_suffix)}}\n                     {{tvalue(pkg_name, comp_name, 'LINKER_FLAGS', config_suffix)}}> APPEND)\n        set_property(TARGET {{ target_namespace }}::{{ comp_name }} PROPERTY INTERFACE_INCLUDE_DIRECTORIES\n                     $<$<CONFIG:{{ configuration }}>:{{tvalue(pkg_name, comp_name, 'INCLUDE_DIRS', config_suffix)}}> APPEND)\n        set_property(TARGET {{ target_namespace }}::{{ comp_name }} PROPERTY INTERFACE_COMPILE_DEFINITIONS\n                     $<$<CONFIG:{{ configuration }}>:{{tvalue(pkg_name, comp_name, 'COMPILE_DEFINITIONS', config_suffix)}}> APPEND)\n        set_property(TARGET {{ target_namespace }}::{{ comp_name }} PROPERTY INTERFACE_COMPILE_OPTIONS\n                     $<$<CONFIG:{{ configuration }}>:\n                     {{tvalue(pkg_name, comp_name, 'COMPILE_OPTIONS_C', config_suffix)}}\n                     {{tvalue(pkg_name, comp_name, 'COMPILE_OPTIONS_CXX', config_suffix)}}> APPEND)\n        set({{ pkg_name }}_{{ comp_name }}_TARGET_PROPERTIES TRUE)\n\n        {%- endfor %}\n\n        \"\"\")\n\n    def get_required_components_names(self):\n        \"\"\"Returns a list of component_name\"\"\"\n        ret = []\n        sorted_comps = self.conanfile.new_cpp_info.get_sorted_components()\n        for comp_name, comp in sorted_comps.items():\n            ret.append(get_component_alias(self.conanfile, comp_name))\n        ret.reverse()\n        return ret\n\n    def get_deps_targets_names(self):\n        \"\"\"\n          - [{foo}::{bar}, ] of the required\n        \"\"\"\n        ret = []\n\n        # Get a list of dependencies target names\n        # Declared cppinfo.requires or .components[].requires\n        if self.conanfile.new_cpp_info.required_components:\n            for dep_name, component_name in self.conanfile.new_cpp_info.required_components:\n                if not dep_name:\n                    # Internal dep (no another component)\n                    dep_name = get_target_namespace(self.conanfile)\n                    req = self.conanfile\n                else:\n                    req = self.conanfile.dependencies.transitive_host_requires[dep_name]\n                    dep_name = get_target_namespace(req)\n\n                component_name = get_component_alias(req, component_name)\n                ret.append(\"{}::{}\".format(dep_name, component_name))\n        elif self.conanfile.dependencies.host_requires:\n            # Regular external \"conanfile.requires\" declared, not cpp_info requires\n            ret = [\"{p}::{p}\".format(p=get_target_namespace(r))\n                                     for r in self.conanfile.dependencies.host_requires]\n        return ret\n", "path": "conan/tools/cmake/cmakedeps/templates/target_configuration.py"}], "after_files": [{"content": "import textwrap\n\nfrom conan.tools.cmake.cmakedeps.templates import CMakeDepsFileTemplate, get_component_alias, \\\n    get_target_namespace\n\n\"\"\"\n\nFooTarget-release.cmake\n\n\"\"\"\n\n\nclass TargetConfigurationTemplate(CMakeDepsFileTemplate):\n\n    @property\n    def filename(self):\n        return \"{}Target-{}.cmake\".format(self.file_name,\n                                            self.cmakedeps.configuration.lower())\n\n    @property\n    def context(self):\n        deps_targets_names = self.get_deps_targets_names() \\\n            if not self.conanfile.is_build_context else []\n        return {\"pkg_name\": self.pkg_name,\n                \"target_namespace\": self.target_namespace,\n                \"config_suffix\": self.config_suffix,\n                \"deps_targets_names\": \";\".join(deps_targets_names),\n                \"components_names\":  self.get_required_components_names(),\n                \"configuration\": self.cmakedeps.configuration}\n\n    @property\n    def template(self):\n        return textwrap.dedent(\"\"\"\\\n\n        {%- macro tvalue(pkg_name, comp_name, var, config_suffix) -%}\n            {{'${'+pkg_name+'_'+comp_name+'_'+var+config_suffix+'}'}}\n        {%- endmacro -%}\n\n        ########### VARIABLES #######################################################################\n        #############################################################################################\n\n        set({{ pkg_name }}_COMPILE_OPTIONS{{ config_suffix }}\n            \"$<$<COMPILE_LANGUAGE:CXX>{{ ':${' }}{{ pkg_name }}_COMPILE_OPTIONS_CXX{{ config_suffix }}}>\"\n            \"$<$<COMPILE_LANGUAGE:C>{{ ':${' }}{{ pkg_name }}_COMPILE_OPTIONS_C{{ config_suffix }}}>\")\n\n        set({{ pkg_name }}_LINKER_FLAGS{{ config_suffix }}\n            \"$<$<STREQUAL{{ ':$' }}<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>{{ ':${' }}{{ pkg_name }}_SHARED_LINK_FLAGS{{ config_suffix }}}>\"\n            \"$<$<STREQUAL{{ ':$' }}<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>{{ ':${' }}{{ pkg_name }}_SHARED_LINK_FLAGS{{ config_suffix }}}>\"\n            \"$<$<STREQUAL{{ ':$' }}<TARGET_PROPERTY:TYPE>,EXECUTABLE>{{ ':${' }}{{ pkg_name }}_EXE_LINK_FLAGS{{ config_suffix }}}>\")\n\n        set({{ pkg_name }}_FRAMEWORKS_FOUND{{ config_suffix }} \"\") # Will be filled later\n        conan_find_apple_frameworks({{ pkg_name }}_FRAMEWORKS_FOUND{{ config_suffix }} \"{{ '${' }}{{ pkg_name }}_FRAMEWORKS{{ config_suffix }}}\" \"{{ '${' }}{{ pkg_name }}_FRAMEWORK_DIRS{{ config_suffix }}}\")\n\n        # Gather all the libraries that should be linked to the targets (do not touch existing variables)\n        set(_{{ pkg_name }}_DEPENDENCIES{{ config_suffix }} \"{{ '${' }}{{ pkg_name }}_FRAMEWORKS_FOUND{{ config_suffix }}} {{ '${' }}{{ pkg_name }}_SYSTEM_LIBS{{ config_suffix }}} {{ deps_targets_names }}\")\n\n        set({{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }} \"\") # Will be filled later\n        set({{ pkg_name }}_LIBRARIES{{ config_suffix }} \"\") # Will be filled later\n        conan_package_library_targets(\"{{ '${' }}{{ pkg_name }}_LIBS{{ config_suffix }}}\"    # libraries\n                                      \"{{ '${' }}{{ pkg_name }}_LIB_DIRS{{ config_suffix }}}\" # package_libdir\n                                      \"{{ '${' }}_{{ pkg_name }}_DEPENDENCIES{{ config_suffix }}}\" # deps\n                                      {{ pkg_name }}_LIBRARIES{{ config_suffix }}   # out_libraries\n                                      {{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }}  # out_libraries_targets\n                                      \"{{ config_suffix }}\"  # config_suffix\n                                      \"{{ pkg_name }}\")    # package_name\n\n        foreach(_FRAMEWORK {{ '${' }}{{ pkg_name }}_FRAMEWORKS_FOUND{{ config_suffix }}})\n            list(APPEND {{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }} ${_FRAMEWORK})\n            list(APPEND {{ pkg_name }}_LIBRARIES{{ config_suffix }} ${_FRAMEWORK})\n        endforeach()\n\n        foreach(_SYSTEM_LIB {{ '${' }}{{ pkg_name }}_SYSTEM_LIBS{{ config_suffix }}})\n            list(APPEND {{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }} ${_SYSTEM_LIB})\n            list(APPEND {{ pkg_name }}_LIBRARIES{{ config_suffix }} ${_SYSTEM_LIB})\n        endforeach()\n\n        # We need to add our requirements too\n        set({{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }} {{ '\"${' }}{{ pkg_name }}_LIBRARIES_TARGETS{{ config_suffix }}{{ '};' }}{{ deps_targets_names }}\")\n        set({{ pkg_name }}_LIBRARIES{{ config_suffix }} {{ '\"${' }}{{ pkg_name }}_LIBRARIES{{ config_suffix }}{{ '};' }}{{ deps_targets_names }}\")\n\n        # FIXME: What is the result of this for multi-config? All configs adding themselves to path?\n        set(CMAKE_MODULE_PATH {{ '${' }}{{ pkg_name }}_BUILD_DIRS{{ config_suffix }}} {{ '${' }}CMAKE_MODULE_PATH})\n        set(CMAKE_PREFIX_PATH {{ '${' }}{{ pkg_name }}_BUILD_DIRS{{ config_suffix }}} {{ '${' }}CMAKE_PREFIX_PATH})\n\n        {%- for comp_name in components_names %}\n\n        ########## COMPONENT {{ comp_name }} FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #############\n\n        set({{ pkg_name }}_{{ comp_name }}_FRAMEWORKS_FOUND{{ config_suffix }} \"\")\n        conan_find_apple_frameworks({{ pkg_name }}_{{ comp_name }}_FRAMEWORKS_FOUND{{ config_suffix }} \"{{ '${'+pkg_name+'_'+comp_name+'_FRAMEWORKS'+config_suffix+'}' }}\" \"{{ '${'+pkg_name+'_'+comp_name+'_FRAMEWORK_DIRS'+config_suffix+'}' }}\")\n\n        set({{ pkg_name }}_{{ comp_name }}_LIB_TARGETS{{ config_suffix }} \"\")\n        set({{ pkg_name }}_{{ comp_name }}_NOT_USED{{ config_suffix }} \"\")\n        set({{ pkg_name }}_{{ comp_name }}_LIBS_FRAMEWORKS_DEPS{{ config_suffix }} {{ '${'+pkg_name+'_'+comp_name+'_FRAMEWORKS_FOUND'+config_suffix+'}' }} {{ '${'+pkg_name+'_'+comp_name+'_SYSTEM_LIBS'+config_suffix+'}' }} {{ '${'+pkg_name+'_'+comp_name+'_DEPENDENCIES'+config_suffix+'}' }})\n        conan_package_library_targets(\"{{ '${'+pkg_name+'_'+comp_name+'_LIBS'+config_suffix+'}' }}\"\n                                      \"{{ '${'+pkg_name+'_'+comp_name+'_LIB_DIRS'+config_suffix+'}' }}\"\n                                      \"{{ '${'+pkg_name+'_'+comp_name+'_LIBS_FRAMEWORKS_DEPS'+config_suffix+'}' }}\"\n                                      {{ pkg_name }}_{{ comp_name }}_NOT_USED{{ config_suffix }}\n                                      {{ pkg_name }}_{{ comp_name }}_LIB_TARGETS{{ config_suffix }}\n                                      \"{{ config_suffix }}\"\n                                      \"{{ pkg_name }}_{{ comp_name }}\")\n\n        set({{ pkg_name }}_{{ comp_name }}_LINK_LIBS{{ config_suffix }} {{ '${'+pkg_name+'_'+comp_name+'_LIB_TARGETS'+config_suffix+'}' }} {{ '${'+pkg_name+'_'+comp_name+'_LIBS_FRAMEWORKS_DEPS'+config_suffix+'}' }})\n        {%- endfor %}\n\n\n\n        ########## GLOBAL TARGET PROPERTIES {{ configuration }} ########################################\n        set_property(TARGET {{target_namespace}}::{{target_namespace}}\n                     PROPERTY INTERFACE_LINK_LIBRARIES\n                     $<$<CONFIG:{{configuration}}>:${{'{'}}{{pkg_name}}_LIBRARIES_TARGETS{{config_suffix}}}\n                                                   ${{'{'}}{{pkg_name}}_LINKER_FLAGS{{config_suffix}}}> APPEND)\n        set_property(TARGET {{target_namespace}}::{{target_namespace}}\n                     PROPERTY INTERFACE_INCLUDE_DIRECTORIES\n                     $<$<CONFIG:{{configuration}}>:${{'{'}}{{pkg_name}}_INCLUDE_DIRS{{config_suffix}}}> APPEND)\n        set_property(TARGET {{target_namespace}}::{{target_namespace}}\n                     PROPERTY INTERFACE_COMPILE_DEFINITIONS\n                     $<$<CONFIG:{{configuration}}>:${{'{'}}{{pkg_name}}_COMPILE_DEFINITIONS{{config_suffix}}}> APPEND)\n        set_property(TARGET {{target_namespace}}::{{target_namespace}}\n                     PROPERTY INTERFACE_COMPILE_OPTIONS\n                     $<$<CONFIG:{{configuration}}>:${{'{'}}{{pkg_name}}_COMPILE_OPTIONS{{config_suffix}}}> APPEND)\n\n        ########## COMPONENTS TARGET PROPERTIES {{ configuration }} ########################################\n\n        {%- for comp_name in components_names %}\n\n        ########## COMPONENT {{ comp_name }} TARGET PROPERTIES ######################################\n        set_property(TARGET {{ target_namespace }}::{{ comp_name }} PROPERTY INTERFACE_LINK_LIBRARIES\n                     $<$<CONFIG:{{ configuration }}>:{{tvalue(pkg_name, comp_name, 'LINK_LIBS', config_suffix)}}\n                     {{tvalue(pkg_name, comp_name, 'LINKER_FLAGS', config_suffix)}}> APPEND)\n        set_property(TARGET {{ target_namespace }}::{{ comp_name }} PROPERTY INTERFACE_INCLUDE_DIRECTORIES\n                     $<$<CONFIG:{{ configuration }}>:{{tvalue(pkg_name, comp_name, 'INCLUDE_DIRS', config_suffix)}}> APPEND)\n        set_property(TARGET {{ target_namespace }}::{{ comp_name }} PROPERTY INTERFACE_COMPILE_DEFINITIONS\n                     $<$<CONFIG:{{ configuration }}>:{{tvalue(pkg_name, comp_name, 'COMPILE_DEFINITIONS', config_suffix)}}> APPEND)\n        set_property(TARGET {{ target_namespace }}::{{ comp_name }} PROPERTY INTERFACE_COMPILE_OPTIONS\n                     $<$<CONFIG:{{ configuration }}>:\n                     {{tvalue(pkg_name, comp_name, 'COMPILE_OPTIONS_C', config_suffix)}}\n                     {{tvalue(pkg_name, comp_name, 'COMPILE_OPTIONS_CXX', config_suffix)}}> APPEND)\n        set({{ pkg_name }}_{{ comp_name }}_TARGET_PROPERTIES TRUE)\n\n        {%- endfor %}\n\n        \"\"\")\n\n    def get_required_components_names(self):\n        \"\"\"Returns a list of component_name\"\"\"\n        ret = []\n        sorted_comps = self.conanfile.new_cpp_info.get_sorted_components()\n        for comp_name, comp in sorted_comps.items():\n            ret.append(get_component_alias(self.conanfile, comp_name))\n        ret.reverse()\n        return ret\n\n    def get_deps_targets_names(self):\n        \"\"\"\n          - [{foo}::{bar}, ] of the required\n        \"\"\"\n        ret = []\n\n        # Get a list of dependencies target names\n        # Declared cppinfo.requires or .components[].requires\n        if self.conanfile.new_cpp_info.required_components:\n            for dep_name, component_name in self.conanfile.new_cpp_info.required_components:\n                if not dep_name:\n                    # Internal dep (no another component)\n                    dep_name = get_target_namespace(self.conanfile)\n                    req = self.conanfile\n                else:\n                    req = self.conanfile.dependencies.transitive_host_requires[dep_name]\n                    dep_name = get_target_namespace(req)\n\n                component_name = get_component_alias(req, component_name)\n                ret.append(\"{}::{}\".format(dep_name, component_name))\n        elif self.conanfile.dependencies.host_requires:\n            # Regular external \"conanfile.requires\" declared, not cpp_info requires\n            ret = [\"{p}::{p}\".format(p=get_target_namespace(r))\n                                     for r in self.conanfile.dependencies.host_requires]\n        return ret\n", "path": "conan/tools/cmake/cmakedeps/templates/target_configuration.py"}]}