We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[bug] cmake_lib template adds find_package to all requirements in test_package
### Describe the bug

Environment: everyone
OS: everyone

The `cmake_lib` template of `conan new` command does generate not invalid CMake code, but redundant. 
On `test_package/CMakeLists.txt` it generates  `find_package` directives of every dependency passed as `-d requires` parameter and it should only generate the `find_package` of the main package, delegating the finding of transitive dependencies to the original package.


### How to reproduce it

```sh
$ conan new cmake_lib -d name=sdk -d version=1.0 -d requires="lib_a/1.0" -d requires="lib_b/1.0"
```

```
File saved: CMakeLists.txt
File saved: conanfile.py
File saved: include/sdk.h
File saved: src/sdk.cpp
File saved: test_package/CMakeLists.txt
File saved: test_package/conanfile.py
File saved: test_package/src/example.cpp
```

```sh
$ cat test_package/CMakeLists.txt
```
```
cmake_minimum_required(VERSION 3.15)
project(PackageTest CXX)

find_package(sdk CONFIG REQUIRED)

find_package(lib_a CONFIG REQUIRED)    # This find_packages are incorrect. 
find_package(lib_b CONFIG REQUIRED)    # Conan should delegate on sdk generator to find their transitive dependencies


add_executable(example src/example.cpp)
target_link_libraries(example sdk::sdk)
```

--- 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/internal/api/new/cmake_lib.py`
Content:
```
1 conanfile_sources_v2 = '''from conan import ConanFile
2 from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
3 
4 
5 class {{package_name}}Recipe(ConanFile):
6     name = "{{name}}"
7     version = "{{version}}"
8     package_type = "library"
9 
10     # Optional metadata
11     license = "<Put the package license here>"
12     author = "<Put your name here> <And your email here>"
13     url = "<Package recipe repository url here, for issues about the package>"
14     description = "<Description of {{ name }} package here>"
15     topics = ("<Put some tag here>", "<here>", "<and here>")
16 
17     # Binary configuration
18     settings = "os", "compiler", "build_type", "arch"
19     options = {"shared": [True, False], "fPIC": [True, False]}
20     default_options = {"shared": False, "fPIC": True}
21 
22     # Sources are located in the same place as this recipe, copy them to the recipe
23     exports_sources = "CMakeLists.txt", "src/*", "include/*"
24 
25     def config_options(self):
26         if self.settings.os == "Windows":
27             self.options.rm_safe("fPIC")
28 
29     def configure(self):
30         if self.options.shared:
31             self.options.rm_safe("fPIC")
32 
33     def layout(self):
34         cmake_layout(self)
35 
36     def generate(self):
37         deps = CMakeDeps(self)
38         deps.generate()
39         tc = CMakeToolchain(self)
40         tc.generate()
41 
42     def build(self):
43         cmake = CMake(self)
44         cmake.configure()
45         cmake.build()
46 
47     def package(self):
48         cmake = CMake(self)
49         cmake.install()
50 
51     def package_info(self):
52         self.cpp_info.libs = ["{{name}}"]
53 
54     {% if requires is defined -%}
55     def requirements(self):
56         {% for require in requires -%}
57         self.requires("{{ require }}")
58         {% endfor %}
59     {%- endif %}
60 
61     {% if tool_requires is defined -%}
62     def build_requirements(self):
63         {% for require in tool_requires -%}
64         self.tool_requires("{{ require }}")
65         {% endfor %}
66     {%- endif %}
67 
68 '''
69 
70 cmake_v2 = """cmake_minimum_required(VERSION 3.15)
71 project({{name}} CXX)
72 
73 {% if requires is defined -%}
74 {% for require in requires -%}
75 find_package({{as_name(require)}} CONFIG REQUIRED)
76 {% endfor %}
77 {%- endif %}
78 
79 
80 add_library({{name}} src/{{name}}.cpp)
81 target_include_directories({{name}} PUBLIC include)
82 
83 {% if requires is defined -%}
84 {% for require in requires -%}
85 target_link_libraries({{name}} PRIVATE {{as_name(require)}}::{{as_name(require)}})
86 {% endfor %}
87 {%- endif %}
88 
89 set_target_properties({{name}} PROPERTIES PUBLIC_HEADER "include/{{name}}.h")
90 install(TARGETS {{name}})
91 """
92 
93 source_h = """#pragma once
94 
95 #include <vector>
96 #include <string>
97 
98 {% set define_name = package_name.upper() %}
99 #ifdef _WIN32
100   #define {{define_name}}_EXPORT __declspec(dllexport)
101 #else
102   #define {{define_name}}_EXPORT
103 #endif
104 
105 {{define_name}}_EXPORT void {{package_name}}();
106 {{define_name}}_EXPORT void {{package_name}}_print_vector(const std::vector<std::string> &strings);
107 """
108 
109 source_cpp = r"""#include <iostream>
110 #include "{{name}}.h"
111 {% if requires is defined -%}
112 {% for require in requires -%}
113 #include "{{ as_name(require) }}.h"
114 {% endfor %}
115 {%- endif %}
116 
117 
118 void {{package_name}}(){
119     {% if requires is defined -%}
120     {% for require in requires -%}
121     {{ as_name(require) }}();
122     {% endfor %}
123     {%- endif %}
124 
125     #ifdef NDEBUG
126     std::cout << "{{name}}/{{version}}: Hello World Release!\n";
127     #else
128     std::cout << "{{name}}/{{version}}: Hello World Debug!\n";
129     #endif
130 
131     // ARCHITECTURES
132     #ifdef _M_X64
133     std::cout << "  {{name}}/{{version}}: _M_X64 defined\n";
134     #endif
135 
136     #ifdef _M_IX86
137     std::cout << "  {{name}}/{{version}}: _M_IX86 defined\n";
138     #endif
139 
140     #ifdef _M_ARM64
141     std::cout << "  {{name}}/{{version}}: _M_ARM64 defined\n";
142     #endif
143 
144     #if __i386__
145     std::cout << "  {{name}}/{{version}}: __i386__ defined\n";
146     #endif
147 
148     #if __x86_64__
149     std::cout << "  {{name}}/{{version}}: __x86_64__ defined\n";
150     #endif
151 
152     #if __aarch64__
153     std::cout << "  {{name}}/{{version}}: __aarch64__ defined\n";
154     #endif
155 
156     // Libstdc++
157     #if defined _GLIBCXX_USE_CXX11_ABI
158     std::cout << "  {{name}}/{{version}}: _GLIBCXX_USE_CXX11_ABI "<< _GLIBCXX_USE_CXX11_ABI << "\n";
159     #endif
160 
161     // MSVC runtime
162     #if defined(_DEBUG)
163         #if defined(_MT) && defined(_DLL)
164         std::cout << "  {{name}}/{{version}}: MSVC runtime: MultiThreadedDebugDLL\n";
165         #elif defined(_MT)
166         std::cout << "  {{name}}/{{version}}: MSVC runtime: MultiThreadedDebug\n";
167         #endif
168     #else
169         #if defined(_MT) && defined(_DLL)
170         std::cout << "  {{name}}/{{version}}: MSVC runtime: MultiThreadedDLL\n";
171         #elif defined(_MT)
172         std::cout << "  {{name}}/{{version}}: MSVC runtime: MultiThreaded\n";
173         #endif
174     #endif
175 
176     // COMPILER VERSIONS
177     #if _MSC_VER
178     std::cout << "  {{name}}/{{version}}: _MSC_VER" << _MSC_VER<< "\n";
179     #endif
180 
181     #if _MSVC_LANG
182     std::cout << "  {{name}}/{{version}}: _MSVC_LANG" << _MSVC_LANG<< "\n";
183     #endif
184 
185     #if __cplusplus
186     std::cout << "  {{name}}/{{version}}: __cplusplus" << __cplusplus<< "\n";
187     #endif
188 
189     #if __INTEL_COMPILER
190     std::cout << "  {{name}}/{{version}}: __INTEL_COMPILER" << __INTEL_COMPILER<< "\n";
191     #endif
192 
193     #if __GNUC__
194     std::cout << "  {{name}}/{{version}}: __GNUC__" << __GNUC__<< "\n";
195     #endif
196 
197     #if __GNUC_MINOR__
198     std::cout << "  {{name}}/{{version}}: __GNUC_MINOR__" << __GNUC_MINOR__<< "\n";
199     #endif
200 
201     #if __clang_major__
202     std::cout << "  {{name}}/{{version}}: __clang_major__" << __clang_major__<< "\n";
203     #endif
204 
205     #if __clang_minor__
206     std::cout << "  {{name}}/{{version}}: __clang_minor__" << __clang_minor__<< "\n";
207     #endif
208 
209     #if __apple_build_version__
210     std::cout << "  {{name}}/{{version}}: __apple_build_version__" << __apple_build_version__<< "\n";
211     #endif
212 
213     // SUBSYSTEMS
214 
215     #if __MSYS__
216     std::cout << "  {{name}}/{{version}}: __MSYS__" << __MSYS__<< "\n";
217     #endif
218 
219     #if __MINGW32__
220     std::cout << "  {{name}}/{{version}}: __MINGW32__" << __MINGW32__<< "\n";
221     #endif
222 
223     #if __MINGW64__
224     std::cout << "  {{name}}/{{version}}: __MINGW64__" << __MINGW64__<< "\n";
225     #endif
226 
227     #if __CYGWIN__
228     std::cout << "  {{name}}/{{version}}: __CYGWIN__" << __CYGWIN__<< "\n";
229     #endif
230 }
231 
232 void {{package_name}}_print_vector(const std::vector<std::string> &strings) {
233     for(std::vector<std::string>::const_iterator it = strings.begin(); it != strings.end(); ++it) {
234         std::cout << "{{package_name}}/{{version}} " << *it << std::endl;
235     }
236 }
237 """
238 
239 
240 test_conanfile_v2 = """import os
241 
242 from conan import ConanFile
243 from conan.tools.cmake import CMake, cmake_layout
244 from conan.tools.build import can_run
245 
246 
247 class {{package_name}}TestConan(ConanFile):
248     settings = "os", "compiler", "build_type", "arch"
249     generators = "CMakeDeps", "CMakeToolchain"
250 
251     def requirements(self):
252         self.requires(self.tested_reference_str)
253 
254     def build(self):
255         cmake = CMake(self)
256         cmake.configure()
257         cmake.build()
258 
259     def layout(self):
260         cmake_layout(self)
261 
262     def test(self):
263         if can_run(self):
264             cmd = os.path.join(self.cpp.build.bindir, "example")
265             self.run(cmd, env="conanrun")
266 """
267 
268 test_cmake_v2 = """cmake_minimum_required(VERSION 3.15)
269 project(PackageTest CXX)
270 
271 find_package({{name}} CONFIG REQUIRED)
272 
273 {% if requires is defined -%}
274 {% for require in requires -%}
275 find_package({{as_name(require)}} CONFIG REQUIRED)
276 {% endfor %}
277 {%- endif %}
278 
279 add_executable(example src/example.cpp)
280 target_link_libraries(example {{name}}::{{name}})
281 """
282 
283 
284 test_main = """#include "{{name}}.h"
285 #include <vector>
286 #include <string>
287 
288 int main() {
289     {{package_name}}();
290 
291     std::vector<std::string> vec;
292     vec.push_back("test_package");
293 
294     {{package_name}}_print_vector(vec);
295 }
296 """
297 
298 cmake_lib_files = {"conanfile.py": conanfile_sources_v2,
299                    "src/{{name}}.cpp": source_cpp,
300                    "include/{{name}}.h": source_h,
301                    "CMakeLists.txt": cmake_v2,
302                    "test_package/conanfile.py": test_conanfile_v2,
303                    "test_package/src/example.cpp": test_main,
304                    "test_package/CMakeLists.txt": test_cmake_v2}
305
```

Path: `conans/__init__.py`
Content:
```
1 CHECKSUM_DEPLOY = "checksum_deploy"  # Only when v2
2 REVISIONS = "revisions"  # Only when enabled in config, not by default look at server_launcher.py
3 OAUTH_TOKEN = "oauth_token"
4 
5 __version__ = '2.4.1'
6
```
--- 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/internal/api/new/cmake_lib.py b/conan/internal/api/new/cmake_lib.py
--- a/conan/internal/api/new/cmake_lib.py
+++ b/conan/internal/api/new/cmake_lib.py
@@ -32,7 +32,18 @@
 
     def layout(self):
         cmake_layout(self)
-
+    {% if requires is defined %}
+    def requirements(self):
+        {% for require in requires -%}
+        self.requires("{{ require }}")
+        {% endfor %}
+    {%- endif %}
+    {%- if tool_requires is defined %}
+    def build_requirements(self):
+        {% for require in tool_requires -%}
+        self.tool_requires("{{ require }}")
+        {% endfor %}
+    {%- endif %}
     def generate(self):
         deps = CMakeDeps(self)
         deps.generate()
@@ -51,20 +62,6 @@
     def package_info(self):
         self.cpp_info.libs = ["{{name}}"]
 
-    {% if requires is defined -%}
-    def requirements(self):
-        {% for require in requires -%}
-        self.requires("{{ require }}")
-        {% endfor %}
-    {%- endif %}
-
-    {% if tool_requires is defined -%}
-    def build_requirements(self):
-        {% for require in tool_requires -%}
-        self.tool_requires("{{ require }}")
-        {% endfor %}
-    {%- endif %}
-
 '''
 
 cmake_v2 = """cmake_minimum_required(VERSION 3.15)
@@ -270,12 +267,6 @@
 
 find_package({{name}} CONFIG REQUIRED)
 
-{% if requires is defined -%}
-{% for require in requires -%}
-find_package({{as_name(require)}} CONFIG REQUIRED)
-{% endfor %}
-{%- endif %}
-
 add_executable(example src/example.cpp)
 target_link_libraries(example {{name}}::{{name}})
 """
diff --git a/conans/__init__.py b/conans/__init__.py
--- a/conans/__init__.py
+++ b/conans/__init__.py
@@ -2,4 +2,4 @@
 REVISIONS = "revisions"  # Only when enabled in config, not by default look at server_launcher.py
 OAUTH_TOKEN = "oauth_token"
 
-__version__ = '2.4.0'
+__version__ = '2.4.1'

{"golden_diff": "diff --git a/conan/internal/api/new/cmake_lib.py b/conan/internal/api/new/cmake_lib.py\n--- a/conan/internal/api/new/cmake_lib.py\n+++ b/conan/internal/api/new/cmake_lib.py\n@@ -32,7 +32,18 @@\n \n     def layout(self):\n         cmake_layout(self)\n-\n+    {% if requires is defined %}\n+    def requirements(self):\n+        {% for require in requires -%}\n+        self.requires(\"{{ require }}\")\n+        {% endfor %}\n+    {%- endif %}\n+    {%- if tool_requires is defined %}\n+    def build_requirements(self):\n+        {% for require in tool_requires -%}\n+        self.tool_requires(\"{{ require }}\")\n+        {% endfor %}\n+    {%- endif %}\n     def generate(self):\n         deps = CMakeDeps(self)\n         deps.generate()\n@@ -51,20 +62,6 @@\n     def package_info(self):\n         self.cpp_info.libs = [\"{{name}}\"]\n \n-    {% if requires is defined -%}\n-    def requirements(self):\n-        {% for require in requires -%}\n-        self.requires(\"{{ require }}\")\n-        {% endfor %}\n-    {%- endif %}\n-\n-    {% if tool_requires is defined -%}\n-    def build_requirements(self):\n-        {% for require in tool_requires -%}\n-        self.tool_requires(\"{{ require }}\")\n-        {% endfor %}\n-    {%- endif %}\n-\n '''\n \n cmake_v2 = \"\"\"cmake_minimum_required(VERSION 3.15)\n@@ -270,12 +267,6 @@\n \n find_package({{name}} CONFIG REQUIRED)\n \n-{% if requires is defined -%}\n-{% for require in requires -%}\n-find_package({{as_name(require)}} CONFIG REQUIRED)\n-{% endfor %}\n-{%- endif %}\n-\n add_executable(example src/example.cpp)\n target_link_libraries(example {{name}}::{{name}})\n \"\"\"\ndiff --git a/conans/__init__.py b/conans/__init__.py\n--- a/conans/__init__.py\n+++ b/conans/__init__.py\n@@ -2,4 +2,4 @@\n REVISIONS = \"revisions\"  # Only when enabled in config, not by default look at server_launcher.py\n OAUTH_TOKEN = \"oauth_token\"\n \n-__version__ = '2.4.0'\n+__version__ = '2.4.1'\n", "issue": "[bug] cmake_lib template adds find_package to all requirements in test_package\n### Describe the bug\n\nEnvironment: everyone\r\nOS: everyone\r\n\r\nThe `cmake_lib` template of `conan new` command does generate not invalid CMake code, but redundant. \r\nOn `test_package/CMakeLists.txt` it generates  `find_package` directives of every dependency passed as `-d requires` parameter and it should only generate the `find_package` of the main package, delegating the finding of transitive dependencies to the original package.\r\n\n\n### How to reproduce it\n\n```sh\r\n$ conan new cmake_lib -d name=sdk -d version=1.0 -d requires=\"lib_a/1.0\" -d requires=\"lib_b/1.0\"\r\n```\r\n\r\n```\r\nFile saved: CMakeLists.txt\r\nFile saved: conanfile.py\r\nFile saved: include/sdk.h\r\nFile saved: src/sdk.cpp\r\nFile saved: test_package/CMakeLists.txt\r\nFile saved: test_package/conanfile.py\r\nFile saved: test_package/src/example.cpp\r\n```\r\n\r\n```sh\r\n$ cat test_package/CMakeLists.txt\r\n```\r\n```\r\ncmake_minimum_required(VERSION 3.15)\r\nproject(PackageTest CXX)\r\n\r\nfind_package(sdk CONFIG REQUIRED)\r\n\r\nfind_package(lib_a CONFIG REQUIRED)    # This find_packages are incorrect. \r\nfind_package(lib_b CONFIG REQUIRED)    # Conan should delegate on sdk generator to find their transitive dependencies\r\n\r\n\r\nadd_executable(example src/example.cpp)\r\ntarget_link_libraries(example sdk::sdk)\r\n```\n", "before_files": [{"content": "conanfile_sources_v2 = '''from conan import ConanFile\nfrom conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps\n\n\nclass {{package_name}}Recipe(ConanFile):\n    name = \"{{name}}\"\n    version = \"{{version}}\"\n    package_type = \"library\"\n\n    # Optional metadata\n    license = \"<Put the package license here>\"\n    author = \"<Put your name here> <And your email here>\"\n    url = \"<Package recipe repository url here, for issues about the package>\"\n    description = \"<Description of {{ name }} package here>\"\n    topics = (\"<Put some tag here>\", \"<here>\", \"<and here>\")\n\n    # Binary configuration\n    settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n    options = {\"shared\": [True, False], \"fPIC\": [True, False]}\n    default_options = {\"shared\": False, \"fPIC\": True}\n\n    # Sources are located in the same place as this recipe, copy them to the recipe\n    exports_sources = \"CMakeLists.txt\", \"src/*\", \"include/*\"\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            self.options.rm_safe(\"fPIC\")\n\n    def configure(self):\n        if self.options.shared:\n            self.options.rm_safe(\"fPIC\")\n\n    def layout(self):\n        cmake_layout(self)\n\n    def generate(self):\n        deps = CMakeDeps(self)\n        deps.generate()\n        tc = CMakeToolchain(self)\n        tc.generate()\n\n    def build(self):\n        cmake = CMake(self)\n        cmake.configure()\n        cmake.build()\n\n    def package(self):\n        cmake = CMake(self)\n        cmake.install()\n\n    def package_info(self):\n        self.cpp_info.libs = [\"{{name}}\"]\n\n    {% if requires is defined -%}\n    def requirements(self):\n        {% for require in requires -%}\n        self.requires(\"{{ require }}\")\n        {% endfor %}\n    {%- endif %}\n\n    {% if tool_requires is defined -%}\n    def build_requirements(self):\n        {% for require in tool_requires -%}\n        self.tool_requires(\"{{ require }}\")\n        {% endfor %}\n    {%- endif %}\n\n'''\n\ncmake_v2 = \"\"\"cmake_minimum_required(VERSION 3.15)\nproject({{name}} CXX)\n\n{% if requires is defined -%}\n{% for require in requires -%}\nfind_package({{as_name(require)}} CONFIG REQUIRED)\n{% endfor %}\n{%- endif %}\n\n\nadd_library({{name}} src/{{name}}.cpp)\ntarget_include_directories({{name}} PUBLIC include)\n\n{% if requires is defined -%}\n{% for require in requires -%}\ntarget_link_libraries({{name}} PRIVATE {{as_name(require)}}::{{as_name(require)}})\n{% endfor %}\n{%- endif %}\n\nset_target_properties({{name}} PROPERTIES PUBLIC_HEADER \"include/{{name}}.h\")\ninstall(TARGETS {{name}})\n\"\"\"\n\nsource_h = \"\"\"#pragma once\n\n#include <vector>\n#include <string>\n\n{% set define_name = package_name.upper() %}\n#ifdef _WIN32\n  #define {{define_name}}_EXPORT __declspec(dllexport)\n#else\n  #define {{define_name}}_EXPORT\n#endif\n\n{{define_name}}_EXPORT void {{package_name}}();\n{{define_name}}_EXPORT void {{package_name}}_print_vector(const std::vector<std::string> &strings);\n\"\"\"\n\nsource_cpp = r\"\"\"#include <iostream>\n#include \"{{name}}.h\"\n{% if requires is defined -%}\n{% for require in requires -%}\n#include \"{{ as_name(require) }}.h\"\n{% endfor %}\n{%- endif %}\n\n\nvoid {{package_name}}(){\n    {% if requires is defined -%}\n    {% for require in requires -%}\n    {{ as_name(require) }}();\n    {% endfor %}\n    {%- endif %}\n\n    #ifdef NDEBUG\n    std::cout << \"{{name}}/{{version}}: Hello World Release!\\n\";\n    #else\n    std::cout << \"{{name}}/{{version}}: Hello World Debug!\\n\";\n    #endif\n\n    // ARCHITECTURES\n    #ifdef _M_X64\n    std::cout << \"  {{name}}/{{version}}: _M_X64 defined\\n\";\n    #endif\n\n    #ifdef _M_IX86\n    std::cout << \"  {{name}}/{{version}}: _M_IX86 defined\\n\";\n    #endif\n\n    #ifdef _M_ARM64\n    std::cout << \"  {{name}}/{{version}}: _M_ARM64 defined\\n\";\n    #endif\n\n    #if __i386__\n    std::cout << \"  {{name}}/{{version}}: __i386__ defined\\n\";\n    #endif\n\n    #if __x86_64__\n    std::cout << \"  {{name}}/{{version}}: __x86_64__ defined\\n\";\n    #endif\n\n    #if __aarch64__\n    std::cout << \"  {{name}}/{{version}}: __aarch64__ defined\\n\";\n    #endif\n\n    // Libstdc++\n    #if defined _GLIBCXX_USE_CXX11_ABI\n    std::cout << \"  {{name}}/{{version}}: _GLIBCXX_USE_CXX11_ABI \"<< _GLIBCXX_USE_CXX11_ABI << \"\\n\";\n    #endif\n\n    // MSVC runtime\n    #if defined(_DEBUG)\n        #if defined(_MT) && defined(_DLL)\n        std::cout << \"  {{name}}/{{version}}: MSVC runtime: MultiThreadedDebugDLL\\n\";\n        #elif defined(_MT)\n        std::cout << \"  {{name}}/{{version}}: MSVC runtime: MultiThreadedDebug\\n\";\n        #endif\n    #else\n        #if defined(_MT) && defined(_DLL)\n        std::cout << \"  {{name}}/{{version}}: MSVC runtime: MultiThreadedDLL\\n\";\n        #elif defined(_MT)\n        std::cout << \"  {{name}}/{{version}}: MSVC runtime: MultiThreaded\\n\";\n        #endif\n    #endif\n\n    // COMPILER VERSIONS\n    #if _MSC_VER\n    std::cout << \"  {{name}}/{{version}}: _MSC_VER\" << _MSC_VER<< \"\\n\";\n    #endif\n\n    #if _MSVC_LANG\n    std::cout << \"  {{name}}/{{version}}: _MSVC_LANG\" << _MSVC_LANG<< \"\\n\";\n    #endif\n\n    #if __cplusplus\n    std::cout << \"  {{name}}/{{version}}: __cplusplus\" << __cplusplus<< \"\\n\";\n    #endif\n\n    #if __INTEL_COMPILER\n    std::cout << \"  {{name}}/{{version}}: __INTEL_COMPILER\" << __INTEL_COMPILER<< \"\\n\";\n    #endif\n\n    #if __GNUC__\n    std::cout << \"  {{name}}/{{version}}: __GNUC__\" << __GNUC__<< \"\\n\";\n    #endif\n\n    #if __GNUC_MINOR__\n    std::cout << \"  {{name}}/{{version}}: __GNUC_MINOR__\" << __GNUC_MINOR__<< \"\\n\";\n    #endif\n\n    #if __clang_major__\n    std::cout << \"  {{name}}/{{version}}: __clang_major__\" << __clang_major__<< \"\\n\";\n    #endif\n\n    #if __clang_minor__\n    std::cout << \"  {{name}}/{{version}}: __clang_minor__\" << __clang_minor__<< \"\\n\";\n    #endif\n\n    #if __apple_build_version__\n    std::cout << \"  {{name}}/{{version}}: __apple_build_version__\" << __apple_build_version__<< \"\\n\";\n    #endif\n\n    // SUBSYSTEMS\n\n    #if __MSYS__\n    std::cout << \"  {{name}}/{{version}}: __MSYS__\" << __MSYS__<< \"\\n\";\n    #endif\n\n    #if __MINGW32__\n    std::cout << \"  {{name}}/{{version}}: __MINGW32__\" << __MINGW32__<< \"\\n\";\n    #endif\n\n    #if __MINGW64__\n    std::cout << \"  {{name}}/{{version}}: __MINGW64__\" << __MINGW64__<< \"\\n\";\n    #endif\n\n    #if __CYGWIN__\n    std::cout << \"  {{name}}/{{version}}: __CYGWIN__\" << __CYGWIN__<< \"\\n\";\n    #endif\n}\n\nvoid {{package_name}}_print_vector(const std::vector<std::string> &strings) {\n    for(std::vector<std::string>::const_iterator it = strings.begin(); it != strings.end(); ++it) {\n        std::cout << \"{{package_name}}/{{version}} \" << *it << std::endl;\n    }\n}\n\"\"\"\n\n\ntest_conanfile_v2 = \"\"\"import os\n\nfrom conan import ConanFile\nfrom conan.tools.cmake import CMake, cmake_layout\nfrom conan.tools.build import can_run\n\n\nclass {{package_name}}TestConan(ConanFile):\n    settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n    generators = \"CMakeDeps\", \"CMakeToolchain\"\n\n    def requirements(self):\n        self.requires(self.tested_reference_str)\n\n    def build(self):\n        cmake = CMake(self)\n        cmake.configure()\n        cmake.build()\n\n    def layout(self):\n        cmake_layout(self)\n\n    def test(self):\n        if can_run(self):\n            cmd = os.path.join(self.cpp.build.bindir, \"example\")\n            self.run(cmd, env=\"conanrun\")\n\"\"\"\n\ntest_cmake_v2 = \"\"\"cmake_minimum_required(VERSION 3.15)\nproject(PackageTest CXX)\n\nfind_package({{name}} CONFIG REQUIRED)\n\n{% if requires is defined -%}\n{% for require in requires -%}\nfind_package({{as_name(require)}} CONFIG REQUIRED)\n{% endfor %}\n{%- endif %}\n\nadd_executable(example src/example.cpp)\ntarget_link_libraries(example {{name}}::{{name}})\n\"\"\"\n\n\ntest_main = \"\"\"#include \"{{name}}.h\"\n#include <vector>\n#include <string>\n\nint main() {\n    {{package_name}}();\n\n    std::vector<std::string> vec;\n    vec.push_back(\"test_package\");\n\n    {{package_name}}_print_vector(vec);\n}\n\"\"\"\n\ncmake_lib_files = {\"conanfile.py\": conanfile_sources_v2,\n                   \"src/{{name}}.cpp\": source_cpp,\n                   \"include/{{name}}.h\": source_h,\n                   \"CMakeLists.txt\": cmake_v2,\n                   \"test_package/conanfile.py\": test_conanfile_v2,\n                   \"test_package/src/example.cpp\": test_main,\n                   \"test_package/CMakeLists.txt\": test_cmake_v2}\n", "path": "conan/internal/api/new/cmake_lib.py"}, {"content": "CHECKSUM_DEPLOY = \"checksum_deploy\"  # Only when v2\nREVISIONS = \"revisions\"  # Only when enabled in config, not by default look at server_launcher.py\nOAUTH_TOKEN = \"oauth_token\"\n\n__version__ = '2.4.1'\n", "path": "conans/__init__.py"}], "after_files": [{"content": "conanfile_sources_v2 = '''from conan import ConanFile\nfrom conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps\n\n\nclass {{package_name}}Recipe(ConanFile):\n    name = \"{{name}}\"\n    version = \"{{version}}\"\n    package_type = \"library\"\n\n    # Optional metadata\n    license = \"<Put the package license here>\"\n    author = \"<Put your name here> <And your email here>\"\n    url = \"<Package recipe repository url here, for issues about the package>\"\n    description = \"<Description of {{ name }} package here>\"\n    topics = (\"<Put some tag here>\", \"<here>\", \"<and here>\")\n\n    # Binary configuration\n    settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n    options = {\"shared\": [True, False], \"fPIC\": [True, False]}\n    default_options = {\"shared\": False, \"fPIC\": True}\n\n    # Sources are located in the same place as this recipe, copy them to the recipe\n    exports_sources = \"CMakeLists.txt\", \"src/*\", \"include/*\"\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            self.options.rm_safe(\"fPIC\")\n\n    def configure(self):\n        if self.options.shared:\n            self.options.rm_safe(\"fPIC\")\n\n    def layout(self):\n        cmake_layout(self)\n    {% if requires is defined %}\n    def requirements(self):\n        {% for require in requires -%}\n        self.requires(\"{{ require }}\")\n        {% endfor %}\n    {%- endif %}\n    {%- if tool_requires is defined %}\n    def build_requirements(self):\n        {% for require in tool_requires -%}\n        self.tool_requires(\"{{ require }}\")\n        {% endfor %}\n    {%- endif %}\n    def generate(self):\n        deps = CMakeDeps(self)\n        deps.generate()\n        tc = CMakeToolchain(self)\n        tc.generate()\n\n    def build(self):\n        cmake = CMake(self)\n        cmake.configure()\n        cmake.build()\n\n    def package(self):\n        cmake = CMake(self)\n        cmake.install()\n\n    def package_info(self):\n        self.cpp_info.libs = [\"{{name}}\"]\n\n'''\n\ncmake_v2 = \"\"\"cmake_minimum_required(VERSION 3.15)\nproject({{name}} CXX)\n\n{% if requires is defined -%}\n{% for require in requires -%}\nfind_package({{as_name(require)}} CONFIG REQUIRED)\n{% endfor %}\n{%- endif %}\n\n\nadd_library({{name}} src/{{name}}.cpp)\ntarget_include_directories({{name}} PUBLIC include)\n\n{% if requires is defined -%}\n{% for require in requires -%}\ntarget_link_libraries({{name}} PRIVATE {{as_name(require)}}::{{as_name(require)}})\n{% endfor %}\n{%- endif %}\n\nset_target_properties({{name}} PROPERTIES PUBLIC_HEADER \"include/{{name}}.h\")\ninstall(TARGETS {{name}})\n\"\"\"\n\nsource_h = \"\"\"#pragma once\n\n#include <vector>\n#include <string>\n\n{% set define_name = package_name.upper() %}\n#ifdef _WIN32\n  #define {{define_name}}_EXPORT __declspec(dllexport)\n#else\n  #define {{define_name}}_EXPORT\n#endif\n\n{{define_name}}_EXPORT void {{package_name}}();\n{{define_name}}_EXPORT void {{package_name}}_print_vector(const std::vector<std::string> &strings);\n\"\"\"\n\nsource_cpp = r\"\"\"#include <iostream>\n#include \"{{name}}.h\"\n{% if requires is defined -%}\n{% for require in requires -%}\n#include \"{{ as_name(require) }}.h\"\n{% endfor %}\n{%- endif %}\n\n\nvoid {{package_name}}(){\n    {% if requires is defined -%}\n    {% for require in requires -%}\n    {{ as_name(require) }}();\n    {% endfor %}\n    {%- endif %}\n\n    #ifdef NDEBUG\n    std::cout << \"{{name}}/{{version}}: Hello World Release!\\n\";\n    #else\n    std::cout << \"{{name}}/{{version}}: Hello World Debug!\\n\";\n    #endif\n\n    // ARCHITECTURES\n    #ifdef _M_X64\n    std::cout << \"  {{name}}/{{version}}: _M_X64 defined\\n\";\n    #endif\n\n    #ifdef _M_IX86\n    std::cout << \"  {{name}}/{{version}}: _M_IX86 defined\\n\";\n    #endif\n\n    #ifdef _M_ARM64\n    std::cout << \"  {{name}}/{{version}}: _M_ARM64 defined\\n\";\n    #endif\n\n    #if __i386__\n    std::cout << \"  {{name}}/{{version}}: __i386__ defined\\n\";\n    #endif\n\n    #if __x86_64__\n    std::cout << \"  {{name}}/{{version}}: __x86_64__ defined\\n\";\n    #endif\n\n    #if __aarch64__\n    std::cout << \"  {{name}}/{{version}}: __aarch64__ defined\\n\";\n    #endif\n\n    // Libstdc++\n    #if defined _GLIBCXX_USE_CXX11_ABI\n    std::cout << \"  {{name}}/{{version}}: _GLIBCXX_USE_CXX11_ABI \"<< _GLIBCXX_USE_CXX11_ABI << \"\\n\";\n    #endif\n\n    // MSVC runtime\n    #if defined(_DEBUG)\n        #if defined(_MT) && defined(_DLL)\n        std::cout << \"  {{name}}/{{version}}: MSVC runtime: MultiThreadedDebugDLL\\n\";\n        #elif defined(_MT)\n        std::cout << \"  {{name}}/{{version}}: MSVC runtime: MultiThreadedDebug\\n\";\n        #endif\n    #else\n        #if defined(_MT) && defined(_DLL)\n        std::cout << \"  {{name}}/{{version}}: MSVC runtime: MultiThreadedDLL\\n\";\n        #elif defined(_MT)\n        std::cout << \"  {{name}}/{{version}}: MSVC runtime: MultiThreaded\\n\";\n        #endif\n    #endif\n\n    // COMPILER VERSIONS\n    #if _MSC_VER\n    std::cout << \"  {{name}}/{{version}}: _MSC_VER\" << _MSC_VER<< \"\\n\";\n    #endif\n\n    #if _MSVC_LANG\n    std::cout << \"  {{name}}/{{version}}: _MSVC_LANG\" << _MSVC_LANG<< \"\\n\";\n    #endif\n\n    #if __cplusplus\n    std::cout << \"  {{name}}/{{version}}: __cplusplus\" << __cplusplus<< \"\\n\";\n    #endif\n\n    #if __INTEL_COMPILER\n    std::cout << \"  {{name}}/{{version}}: __INTEL_COMPILER\" << __INTEL_COMPILER<< \"\\n\";\n    #endif\n\n    #if __GNUC__\n    std::cout << \"  {{name}}/{{version}}: __GNUC__\" << __GNUC__<< \"\\n\";\n    #endif\n\n    #if __GNUC_MINOR__\n    std::cout << \"  {{name}}/{{version}}: __GNUC_MINOR__\" << __GNUC_MINOR__<< \"\\n\";\n    #endif\n\n    #if __clang_major__\n    std::cout << \"  {{name}}/{{version}}: __clang_major__\" << __clang_major__<< \"\\n\";\n    #endif\n\n    #if __clang_minor__\n    std::cout << \"  {{name}}/{{version}}: __clang_minor__\" << __clang_minor__<< \"\\n\";\n    #endif\n\n    #if __apple_build_version__\n    std::cout << \"  {{name}}/{{version}}: __apple_build_version__\" << __apple_build_version__<< \"\\n\";\n    #endif\n\n    // SUBSYSTEMS\n\n    #if __MSYS__\n    std::cout << \"  {{name}}/{{version}}: __MSYS__\" << __MSYS__<< \"\\n\";\n    #endif\n\n    #if __MINGW32__\n    std::cout << \"  {{name}}/{{version}}: __MINGW32__\" << __MINGW32__<< \"\\n\";\n    #endif\n\n    #if __MINGW64__\n    std::cout << \"  {{name}}/{{version}}: __MINGW64__\" << __MINGW64__<< \"\\n\";\n    #endif\n\n    #if __CYGWIN__\n    std::cout << \"  {{name}}/{{version}}: __CYGWIN__\" << __CYGWIN__<< \"\\n\";\n    #endif\n}\n\nvoid {{package_name}}_print_vector(const std::vector<std::string> &strings) {\n    for(std::vector<std::string>::const_iterator it = strings.begin(); it != strings.end(); ++it) {\n        std::cout << \"{{package_name}}/{{version}} \" << *it << std::endl;\n    }\n}\n\"\"\"\n\n\ntest_conanfile_v2 = \"\"\"import os\n\nfrom conan import ConanFile\nfrom conan.tools.cmake import CMake, cmake_layout\nfrom conan.tools.build import can_run\n\n\nclass {{package_name}}TestConan(ConanFile):\n    settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n    generators = \"CMakeDeps\", \"CMakeToolchain\"\n\n    def requirements(self):\n        self.requires(self.tested_reference_str)\n\n    def build(self):\n        cmake = CMake(self)\n        cmake.configure()\n        cmake.build()\n\n    def layout(self):\n        cmake_layout(self)\n\n    def test(self):\n        if can_run(self):\n            cmd = os.path.join(self.cpp.build.bindir, \"example\")\n            self.run(cmd, env=\"conanrun\")\n\"\"\"\n\ntest_cmake_v2 = \"\"\"cmake_minimum_required(VERSION 3.15)\nproject(PackageTest CXX)\n\nfind_package({{name}} CONFIG REQUIRED)\n\nadd_executable(example src/example.cpp)\ntarget_link_libraries(example {{name}}::{{name}})\n\"\"\"\n\n\ntest_main = \"\"\"#include \"{{name}}.h\"\n#include <vector>\n#include <string>\n\nint main() {\n    {{package_name}}();\n\n    std::vector<std::string> vec;\n    vec.push_back(\"test_package\");\n\n    {{package_name}}_print_vector(vec);\n}\n\"\"\"\n\ncmake_lib_files = {\"conanfile.py\": conanfile_sources_v2,\n                   \"src/{{name}}.cpp\": source_cpp,\n                   \"include/{{name}}.h\": source_h,\n                   \"CMakeLists.txt\": cmake_v2,\n                   \"test_package/conanfile.py\": test_conanfile_v2,\n                   \"test_package/src/example.cpp\": test_main,\n                   \"test_package/CMakeLists.txt\": test_cmake_v2}\n", "path": "conan/internal/api/new/cmake_lib.py"}, {"content": "CHECKSUM_DEPLOY = \"checksum_deploy\"  # Only when v2\nREVISIONS = \"revisions\"  # Only when enabled in config, not by default look at server_launcher.py\nOAUTH_TOKEN = \"oauth_token\"\n\n__version__ = '2.4.1'\n", "path": "conans/__init__.py"}]}