Qbs Manual

Qbs 1.14.0

# PkgConfigProbe

Retrieves the information about installed packages using the pkg-config binary. More...

- List of all members, including inherited members

## Properties

- compilerFlags : stringList
- defines : stringList
- exactVersion : string
- executable : string
- forStaticBuild : bool
- includePaths : stringList
- libDirs : stringList
- libraries : stringList
- libraryPaths : stringList
- linkerFlags : stringList
- maxVersion : string
- minVersion : string
- modversion : stringList
- name : string
- packageNames : stringList
- sysroot : string

## Detailed Description

This probe takes the package name or the list of package names as input and returns the information that is required to compile and link using those packages.

Usually, you can simply use a Depends item as described in How do I build against libraries that provide pkg-config files?.

Alternatively, the probe can be used directly as follows:

      CppApplication {
          name: project.name
          Probes.PkgConfigProbe {
              id: pkgConfig
              name: "QtCore"
              minVersion: '4.0.0'
              maxVersion: '5.99.99'
          }
          files: 'main.cpp'
          cpp.cxxFlags: pkgConfig.cflags
          cpp.linkerFlags: pkgConfig.libs
      }

## Property Documentation

compilerFlags : stringList

This output property contains the list of flags that should be passed to a compiler when using requested package.

Default: Undefined

defines : stringList

This output property contains the list of defines that should be passed to a compiler when using requested package.

Default: Undefined

exactVersion : string

The exact version of the required package. If set, pkg-config will ignore packages with version greater than the value of this property.

Default: Undefined

executable : string

The name of or the path to the pkg-config executable.

Default: "pkg-config"

forStaticBuild : bool

If `true`, pkg-config will return linker flags for a static linking instead of dynamic.

Default: `false`

includePaths : stringList

This output property contains the list of include paths that should be passed to a compiler when using requested package.

Default: Undefined

libDirs : stringList

List of full, non-sysrooted paths where pkg-config should search for .pc files. This overrides the built-in path (which is usually /usr/lib/pkgconfig).

This property sets the value of the `PKG_CONFIG_LIBDIR` environment variable passed to the `pkg-config` binary.

Default: Undefined

libraries : stringList

This output property contains the list of library names that should be passed to a linker when using requested package.

Default: Undefined

libraryPaths : stringList

This output property contains the list of library paths that should be passed to a linker when using requested package.

This property sets the value of the PKG_CONFIG_LIBDIR environment variable passed to the `pkg-config` binary.

Default: Undefined

linkerFlags : stringList

This output property contains the list of flags that should be passed to a linker when using requested package.

Default: Undefined

maxVersion : string

The maximum version of the required package. If set, pkg-config will ignore packages with version that is not equal to the value of this property.

Default: Undefined

minVersion : string

The minimum version of the required package. If set, pkg-config will ignore packages with version less than the value of this property.

Default: Undefined

modversion : stringList

This output property contains the version of the found package.

Default: Undefined

name : string

The name this probe. This property is used as PkgConfigProbe.packageNames value by default.

Default: Undefined

packageNames : stringList

The list of package names to pass to the pkg-config executable. For each package, pkg-config will return the information required to compile and link to this package.

Default: [PkgConfigProbe.name]

sysroot : string

This property sets the value of the `PKG_CONFIG_SYSROOT_DIR` environment variable passed to the `pkg-config` binary. This variable modifies -I and -L flags to use the directories located in target sysroot.

This property is useful when cross-compiling packages that use `pkg-config` to determine CFLAGS and LDFLAGS. For example, if `sysroot` is set to `/var/target`, a `-I/usr/include/libfoo` will become `-I/var/target/usr/include/libfoo`.

Default: `qbs.sysroot`