Skip to content

Commit 01dcdd6

Browse files
authored
Add pkg_config_name none property (#4135)
1 parent 1f47490 commit 01dcdd6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

reference/tools/gnu/pkgconfigdeps.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ Additionally, a ``<PKG-NAME>.pc`` is generated to maintain compatibility for con
7979
``<PKG-NAME>.pc`` file declares all the components of the package as requires while the rest of the fields will be empty, relying on
8080
the propagation of flags coming from the components ``<[PKG-NAME]-[COMP-NAME]>.pc`` files.
8181

82+
If you want to disable the generation of the ``<PKG-NAME>.pc`` file,
83+
you can set the ``pkg_config_name`` property to the ``none`` string value:
84+
85+
.. code-block:: python
86+
87+
def package_info(self):
88+
self.cpp_info.set_property("pkg_config_name", "none")
89+
self.cpp_info.components["crypto"].set_property("pkg_config_name", "mylib-crypto")
90+
91+
This will generate only the ``mylib-foo.pc`` file, but not the ``mylib.pc`` one.
92+
This can only be done at the global ``cpp_info`` level, not at component level.
93+
8294

8395
Reference
8496
---------
@@ -174,7 +186,7 @@ Properties
174186

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

177-
- **pkg_config_name** property will define the name of the generated ``*.pc`` file (``xxxxx.pc``)
189+
- **pkg_config_name** property will define the name of the generated ``*.pc`` file (``xxxxx.pc``), or the string ``none`` to disable the generation of the global ``*.pc`` file for the package.
178190
- **pkg_config_aliases** property sets some aliases of any package/component name for *pkg_config* generator. This property only accepts list-like Python objects.
179191
- **pkg_config_custom_content** property will add user defined content to the *.pc* files created by this generator as freeform variables.
180192
That content can be a string or a dict-like Python object. Notice that the variables declared here will overwrite those ones already defined by Conan.

0 commit comments

Comments
 (0)