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

[PkgConfigDeps] Component versions #2433

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions conan_v2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ Properties related to *pkg_config*, supported by both legacy :ref:`pkg_config<pk
- **pkg_config_name** property equivalent to the ``names`` attribute.
- **pkg_config_custom_content** property supported by both generators that will add user
defined content to the *.pc* files created by the generator
- **component_version** property supported by both generators that sets a custom version to be used
czoido marked this conversation as resolved.
Show resolved Hide resolved
in the ``Version`` field belonging to the created ``*.pc`` file for that component.

Properties related to *pkg_config*, only supported by new :ref:`PkgConfigDeps<PkgConfigDeps>`:

Expand Down
7 changes: 4 additions & 3 deletions reference/conanfile/tools/gnu/pkgconfigdeps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ Properties

The following properties affect the ``PkgConfigDeps`` generator:

- **pkg_config_name** property sets the ``names`` property for *pkg_config* generator.
- **pkg_config_name** property will define the name of the generated ``*.pc`` file (``xxxxx.pc``)
- **pkg_config_aliases** property sets some aliases of any package/component name for *pkg_config* generator. This property only accepts list-like Python objects.
- **pkg_config_custom_content** property supported by the *pkg_config* generator that will add user
defined content to the *.pc* files created by this generator.
- **pkg_config_custom_content** property will add user defined content to the *.pc* files created by this generator.
- **component_version** property sets a custom version to be used in the ``Version`` field belonging to the created ``*.pc`` file for that component.

These properties can be defined at global ``cpp_info`` level or at component level.

Expand All @@ -120,6 +120,7 @@ Example:
self.cpp_info.set_property("pkg_config_name", "myname")
self.cpp_info.components["mycomponent"].set_property("pkg_config_name", "componentname")
self.cpp_info.components["mycomponent"].set_property("pkg_config_aliases", ["alias1", "alias2"])
self.cpp_info.components["mycomponent"].set_property("component_version", "1.14.12")


Names and aliases
Expand Down
10 changes: 10 additions & 0 deletions reference/generators/pkg_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,13 @@ the propagation of flags coming from the components *<COMP-NAME>.pc* files.

Go to :ref:`Integrations/pkg-config and pc files/Use the pkg_config generator<pkg_config_generator_example>`
if you want to learn how to use this generator.


Properties
++++++++++

The following properties affect the ``pkg_config`` generator:

- **pkg_config_name** property equivalent to the ``names`` attribute.
- **pkg_config_custom_content** property will add user defined content to the *.pc* files created by this generator.
- **component_version** property sets a custom version to be used in the ``Version`` field belonging to the created ``*.pc`` file for that component.