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

Add 'origin' metadata to cmake dependencies #131

Merged
merged 3 commits into from
Oct 4, 2023
Merged
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
11 changes: 9 additions & 2 deletions colcon_cmake/package_identification/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import re
import sys

from colcon_core.dependency_descriptor import DependencyDescriptor
from colcon_core.logging import colcon_logger
from colcon_core.package_identification \
import PackageIdentificationExtensionPoint
Expand Down Expand Up @@ -187,9 +188,15 @@ def extract_dependencies(content):
:returns: The dependencies name
:rtype: list
"""
return \
extract_find_package_calls(content) | \
metadata = {
'origin': 'cmake',
}

return {
DependencyDescriptor(d, metadata=metadata)
for d in extract_find_package_calls(content) |
_extract_pkg_config_calls(content)
}


def extract_find_package_calls(content, *, function_name='find_package'):
Expand Down
Loading