- Qbs Manual
- Qbs 1.21.0

# qbspkgconfig QML Type

Module provider based on the qbspkg-config library. More...

Import Statement: | import QbsModuleProviders .
Since: | Qt 1.20

- List of all members, including inherited members

## Properties

- executableFilePath : string
- extraPaths : stringList
- libDirs : stringList
- mergeDependencies : bool
- staticMode : bool
- sysroot : path

## Detailed Description

Qbs uses a built-in parser of the `*.pc` files and does not require the presence of the `pkg-config` tool in the system. However, if the `pkg-config` tool is present, Qbs will use the same libDirs as the system pkg-config uses by default; otherwise, a built-in list of paths is used.

In order to enable usage of this provider in your Product, set the qbsModuleProviders property as shown in the example below:

     CppApplication {
         consoleApplication: true
         Depends { name: "zlib"; required: false }
         condition: zlib.present
         name: "PkgConfigProviderExample"
         files: "main.c"
         qbsModuleProviders: ["qbspkgconfig"]
     }

## Property Documentation

executableFilePath : string

The path to the `pkg-config` executable. If not set, the pkg-config from PATH is used.

Default: undefined

extraPaths : stringList

Set this if you need to add extra search directories.

This property is the equivalent of the `PKG_CONFIG_PATH` variable for the `pkg-config` tool.

Default: Undefined

libDirs : stringList

Set this if you need to overwrite the default search directories.

Note: You do not need to set this for cross-compilation in order to point to the sysroot. Qbs does that for you.

This property is the equivalent of the `PKG_CONFIG_LIBDIR` variable for the `pkg-config` tool.

Default: Undefined

mergeDependencies : bool

Holds whether dependencies should be merged by pkg-config or Qbs.

If set to true, dependencies are merged by pkg-config meaning each generated module is self-contained and does not depend on other modules. If set to false, generated modules may depend on other modules and property merging is done by Qbs. The latter approach gives Qbs more information about dependencies, but may have performance implications during resolve phase, e.g. when using ABSEIL library.

Default: `true`

staticMode : bool

If this property is `true`, then Qbs will include "private" libs and dependencies of the package. This property is the equivalent of the `--static` option for the `pkg-config` tool.

Set this if your product is to be linked statically.

Default: `false`

sysroot : path

Set this property if you need to overwrite the default search sysroot path used by `pkg-config`.

This can be useful if `pkg-config` files are located in the directory other than qbs.sysroot. This is the case on macOS platform - all XCode profiles are sysrooted to the SDK directory, but `pkg-config` is typically intalled using Brew and resides in the `/usr/local` directory.

Setting this property to `undefined` or empty (`""`) value will use pkg-config's default search paths:

     qbs build module-providers.pkgconfig.sysroot:undefined

This property is the equivalent of the `PKG_CONFIG_SYSROOT_DIR` variable for the `pkg-config` tool.

Default: `""` on macOS, `qbs.sysroot` on other platforms