Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove find_package generation on test_package of cmake_lib template #16451

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 12 additions & 21 deletions conan/internal/api/new/cmake_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,18 @@ def configure(self):

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()
Expand All @@ -51,20 +62,6 @@ def package(self):
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)
Expand Down Expand Up @@ -270,12 +267,6 @@ def test(self):

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}})
"""
Expand Down
2 changes: 1 addition & 1 deletion conans/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'