- Qbs Manual
- Module qbs
- Qt Build Suite 1.4.0

# Module qbs

The `qbs` module is implicitly loaded in every product. It contains properties of the current build environment, independent of the used programming languages and toolchains.

## buildVariant

Type: | `string`
Default: | `"debug"`

Contains the name of the build variant for the current build.

## debugInformation

Type: | `bool`
Default: | `true` for debug builds, `false` otherwise

Specifies whether to generate debug information.

## enableDebugCode

Type: | `bool`
Default: | `true` for debug builds, `false` otherwise

Specifies whether to compile debug code in the product. This is typically enabled for debug builds and disabled for release builds.

## optimization

Type: | `string`
Allowed Values: | `"none"`, `"fast"`, `"small"`
Default: | `"none"` for debug builds, `"fast"` for release builds

Specifies the general type of optimization that should be performed by all toolchains.

## hostOS

Type: | `stringList` (read only)

This property is set by Qbs internally and specifies the OS Qbs is running on. The possible values for this property are the values of `targetOS`, though some may not be supported.

## hostOSVersion

Type: | `string` (read only)

The host operating system version. Currently only defined for Windows and OS X. Consists of two or three numbers separated by dots, for instance "10.9" or "6.3.9600".

## hostOSBuildVersion

Type: | `string` (read only)

The host operating system's build version. Currently only defined for Windows and OS X. On Windows, this is the 4 or 5 digit Windows build number and is equivalent to `versionPatch`. On OS X, this is a standard build number in the Apple versioning scheme, for instance "13C64".

## versionMajor

Type: | `int`
Default: | `hostOSVersionParts[0]`

The host operating system major version.

## versionMinor

Type: | `int`
Default: | `hostOSVersionParts[1]`

The host operating system minor version.

## versionParts

Type: | `list`
Default: | `empty`

The host operating system version as a list. For instance, Windows 8.1 (version 6.3.9600) would correspond to a value of `[6, 3, 9600]`.

## versionPatch

Type: | `int`
Default: | `hostOSVersionParts[2]`

The host operating system patch level.

## targetOS

Type: | `stringList`
Possible Values: | one or more of: `"aix"`, `"android"`, `"blackberry"`, `"bsd"`, `"bsd4"`, `"bsdi"`, `"cygwin"`, `"darwin"`, `"dgux"`, `"dynix"`, `"freebsd"`, `"hpux"`, `"hurd"`, `"integrity"`, `"ios"`, `"ios-simulator"`, `"irix"`, `"linux"`, `"lynx"`, `"osx"`, `"msdos"`, `"nacl"`, `"netbsd"`, `"openbsd"`, `"os2"`, `"os2emx"`, `"osf"`, `"qnx"`, `"qnx6"`, `"reliant"`, `"sco"`, `"solaris"`, `"symbian"`, `"ultrix"`, `"unix"`, `"unixware"`, `"vxworks"`, `"windows"`, `"windowsce"`, `"windowsphone"`, `"winrt"`

Specifies the OS you want to build the project for. This is typically set in a profile.

## architecture

Type: | `string`

Specifies the target platform's processor architecture. This is typically set in a profile. Currently used values are: `"x86"`, `"x86_64"` and `"arm"`.

## toolchain

Type: | `stringList`
Allowed Values: | `"gcc"`, `"llvm"`, `"clang"`, `"mingw"`, `"msvc"`

Specifies the attributes of the toolchain that is going to be used for this build.

## sysroot

Type: | `string`
Default: | `undefined`

Specifies the sysroot of the target platform. This property is typically set in a profile for cross-compiling.

## install

Type: | `bool`
Default: | `false`

Specifies whether to install a certain set of files. This is typically set in a `Group` item to mark a number of files as installable.

Note: Artifacts for which this property is enabled automatically receive the file tag "installable". This is useful for writing packaging-related rules.

## installSourceBase

Type: | `string`
Default: | see below

Specifies the base directory of the local files that are going to be installed. The source base directory is omitted from the target directory path specified in `installDir`. The default value of this property is the directory of the current file to be installed, relative to the product's source directory.

## installDir

Type: | `string`
Default: | `undefined`

Specifies the installation directory for the files of a product or a `Group`. The value of this property is a path that is relative to `installPrefix`.

## installPrefix

Type: | `string`
Default: | `empty`

Specifies the global installation prefix. It is implicitly prepended to all values of `installDir`. The `installPrefix` itself is relative to the `installRoot` in the context of installation.

## installRoot

Type: | `string`
Default: | `<build dir>/install-root`

Specifies the global installation root. It is implicitly prepended to all values of `installPrefix` in the context of installation.

Note: This property is fundamentally different from `installDir` and `installPrefix` in that it must not be visible to the code being built. In fact, the install root is often just a temporary location used to package the binaries, which should therefore not assume they will be in that location at run-time.

## pathListSeparator

Type: | `string`

Holds the platform-specific separator for path list that is used in environment variables or other contexts. E.g. on Windows is this `";"`, on Unix derivatives `":"`.