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.

General Properties

configurationNamestring1.6"default"Contains the name of the current build configuration.
buildVariantstring1.0"debug"Contains the name of the build variant for the current build.
debugInformationbool1.0true for debug builds, false otherwiseSpecifies whether to generate debug information.
enableDebugCodebool1.0true for debug builds, false otherwiseSpecifies whether to compile debug code in the product. This is typically enabled for debug builds and disabled for release builds.
optimizationstring1.0"none" for debug builds, "fast" for release buildsSpecifies the general type of optimization that should be performed by all toolchains. Allowed values: "none", "fast", "small"
targetOSstringList1.0undefinedSpecifies the OS you want to build the project for. This is typically set in a profile. Possible values include one or more of the following: "aix", "android", "bsd", "bsd4", "bsdi", "cygwin", "darwin", "dgux", "dynix", "freebsd", "hpux", "hurd", "integrity", "ios", "ios-simulator", "irix", "linux", "lynx", "macos", "msdos", "nacl", "netbsd", "openbsd", "os2", "os2emx", "osf", "qnx", "qnx6", "reliant", "sco", "solaris", "symbian", "ultrix", "unix", "unixware", "vxworks", "windows"
architecturestring1.0undefinedSpecifies the target platform's processor architecture. undefined indicates that the target platform is architecture-independent (for example the CLR or JVM). This is typically set in a profile. Commonly used values are: "x86", "x86_64" and "arm".
toolchainstringList1.0undefinedSpecifies the attributes of the toolchain that is going to be used for this build. Typical values include: "gcc", "llvm", "clang", "mingw", "msvc"
sysrootstring1.0undefinedSpecifies the sysroot of the target platform. This property is typically set in a profile for cross-compiling.
pathListSeparatorstring1.0";" on Windows, ":" on UnixHolds the platform-specific separator for path list that is used in environment variables or other contexts.
nullDevicestring1.4.2"NUL" on Windows, "/dev/null" on UnixHolds the platform-specific file path corresponding to the null device.
shellPathpath1.5"%COMSPEC%" on Windows, "/bin/sh" on UnixHolds the platform-specific file path corresponding to the command line interpreter. On Windows this is the path to cmd.exe, which is held in the COMSPEC environment variable - typically C:/Windows/System32/cmd.exe, and on Unix-like platforms this is /bin/sh.

Environment Properties

This section lists constant, read-only properties set by Qbs internally. These properties should not be overridden.

hostOSstringList (read only)1.0undefinedThis 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.
hostOSVersionstring (read only)1.2undefinedThe host operating system version. Currently only defined for Windows and Apple platforms. Consists of two or three numbers separated by dots, for instance "10.9" or "6.3.9600".
hostOSBuildVersionstring (read only)1.2undefinedThe host operating system's build version. Currently only defined for Windows and Apple platforms. On Windows, this is the 4 or 5 digit Windows build number and is equivalent to versionPatch. On Apple platforms, this is a standard build number in the Apple versioning scheme, for instance "13C64".
hostOSVersionMajorint (read only)1.2hostOSVersionParts[0]The host operating system major version.
hostOSVersionMinorint (read only)1.2hostOSVersionParts[1]The host operating system minor version.
hostOSVersionPartslist (read only)1.2emptyThe 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].
hostOSVersionPatchint (read only)1.2hostOSVersionParts[2]The host operating system patch level.
versionstring (read only)1.4.1Version number of Qbs as a string, i.e. "1.4.1".
versionMajorint (read only)1.4.1Major version number of Qbs.
versionMinorint (read only)1.4.1Minor version number of Qbs.
versionPatchint (read only)1.4.1Patch version number of Qbs.

Installation Properties

This section lists properties specific to the Qbs installation mechanism. See Installing Files for more information.

installbool1.0falseSpecifies 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.

installSourceBasestring1.4see belowSpecifies 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.
installDirstring1.0undefinedSpecifies 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.
installPrefixstring1.1emptySpecifies 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.
installRootstring1.4<build dir>/install-rootSpecifies 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. For the same reason, this property is usually not set from within project files.

Multiplexing Properties

This section lists properties specific to product multiplexing.

architecturesstringList1.9["armv5te"] on Android, same as Xcode on Apple platforms, otherwise equivalent to [qbs.architecture]Specifies the architectures the product will be built for.
buildVariantsstringList1.9equivalent to [qbs.buildVariant]Specifies the build variants the product will be built for.
profilesstringList1.9[product.profile]The profiles for which the product should be built. For each profile listed here, one instance of the product will be built according to the properties set in the respective profile. This property is the same as product.profiles, which takes precedence.

© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.