- Qbs Manual
- QbsModules
- Exporter.pkgconfig
- Qbs 3.3.1

# Exporter.pkgconfig

Provides support for generating pkg-config files. More...

Since: | Qbs 1.12

- List of all members, including inherited members

## Properties

- autoDetect : bool
- cflagsEntry : stringList
- conflictsEntry : stringList
- customVariables : string
- excludedDependencies : stringList
- fileName : string
- libsEntry : stringList
- libsPrivateEntry : stringList
- nameEntry : string
- requiresEntry : stringList
- requiresPrivateEntry : stringList
- transformFunction : var
- urlEntry : string
- versionEntry : string

## Detailed Description

The `Exporter.pkgconfig` module contains the properties and rules to create a pkg-config metadata (`.pc`) file for a Product.

By default, Qbs will attempt to derive some of the `.pc` file's contents from the product's Export item. This behavior can be suppressed by setting the autoDetect property to `false`.

### Relevant File Tags

Tag | Since | Description
--- | --- | ---
`"Exporter.pkgconfig.pc"` | 1.12.0 | This tag is attached to the generated `.pc` file.

## Property Documentation

autoDetect : bool

If this property is enabled, then Qbs will try to derive various `.pc` file entries from the contents of the product's Export item, including the dependencies declared therein. Values for these fields can still be explicitly provided via the respective properties, in which case they will be concatenated with the auto-detected ones. If an exported dependency is known to correspond to a pkg-config module (either by pulling in the `Exporter.pkgconfig` module or by appearing in the requiresEntry property), it will end up in the `Requires` field of the `.pc` file, otherwise its exported cpp properties will be collected for use in the `Cflags` and `Libs` fields. The excludedDependencies property can be used to ignore specific products altogether.

Default: `true`

cflagsEntry : stringList

The value of the `Cflags` field in the `.pc` file.

If autoDetect is enabled, then this value will be appended to the flags derived from the product's Export item and the dependencies declared therein.

Default: `[]`

conflictsEntry : stringList

The value of the `Conflicts` field in the `.pc` file.

Default: `[]`

customVariables : string

Use this property to add arbitrary variable assignments into the `.pc` file. The property is a map that will produce one assignment per entry. The keys and values of the map represent the left-hand sides and right-hand sides of these assignments, respectively. The values are strings that will be written into the file verbatim.

Default: Undefined

excludedDependencies : stringList

If autoDetect is enabled, the entries of this property will be matched against the product's exported dependencies. In case such a dependency's name is present in the array, Qbs will not traverse that dependency to collect entries for the `Cflags`, `Libs`, `Requires` and `Requires.private` fields.

This list must not contain any values that are present in requiresEntry.

Default: `undefined`

fileName : string

The file name of the generated pkg-config metadata file.

Default: `product.targetName + ".pc"`

libsEntry : stringList

The value of the `Libs` field in the `.pc` file.

If autoDetect is enabled, then this value will be appended to the flags derived from the product's Export item and the dependencies declared therein.

Default: `[]`

libsPrivateEntry : stringList

The value of the `Libs.Private` field in the `.pc` file.

Default: `[]`

nameEntry : string

The value of the `Name` field in the `.pc` file.

Default: `product.name`

requiresEntry : stringList

The value of the `Requires` field in the `.pc` file.

If autoDetect is enabled, then those of the product's exported dependencies that pull in the `Exporter.pkgconfig` module will also end up in the `Requires` field, provided they are not listed in excludedDependencies.

If an exported dependency matches an entry of this array, Qbs will not traverse that dependency to gather cpp properties for use in the cflagsEntry and libsEntry values, as pkg-config takes care of that itself.

Default: `[]`

requiresPrivateEntry : stringList

The value of the `Requires.private` field in the `.pc` file.

If autoDetect is enabled, then those of the product's non-exported dependencies that pull in the `Exporter.pkgconfig` module will also end up in the `Requires.private` field, provided they are not listed in excludedDependencies.

Default: `[]`

transformFunction : var

A function with the signature `function(product, moduleName, propertyName, value)`. This can be useful to "fine-tune" property values if autoDetect is enabled, in case they need amending for the purpose of pkg-config. The `product` parameter represents the exporting product, the remaining parameters describe the module property. The modified value of the module property shall be returned.

Default: `undefined`

urlEntry : string

The value of the `URL` field in the `.pc` file.

Default: `undefined`

versionEntry : string

The value of the `Version` field in the `.pc` file.

Default: `product.version`