Qbs is a cross-platform free and open-source software for managing the build process of software. It was designed to support large, complex projects, written in any number of programming languages, primarily C/C++. Qbs is an all-in-one tool that generates a build graph from a high-level project description, and additionally undertakes the task of executing the commands in the low-level build graph. Qbs was originally created by Nokia, then The Qt Company, who distributes it along with their Qt toolkit. It integrates with the Qt framework, and automates the creation of moc and rcc sources, which are used in Qt's meta-object system and in the integration of binary resources. The developers hoped to eventually push for Qbs to replace qmake as Qt's own build system, however in 2019 The Qt Company selected cmake for this task for Qt 6. They cited cmake's extreme popularity as a factor.
Features
Qbs is unique in that it has no mechanism for in-source builds, guaranteeing the ability to create several builds from a single source tree, including building them from a single command invocation and in parallel. This is a key feature, ensuring that source files remain unaffected if a build directory is removed and that no output artifacts are written into the source directory. Qbs has no built-in support for any particular programming language, toolkit, or library. This is again in contrast to qmake, which hardcodes support for many Qt-related tools and workflows. Instead, Qbs is provided with a set of modules written in a QML dialect and JavaScript that enable support for a variety of programming languages and tools. Qbs currently provides modules supporting the Android SDK and NDK, C, C++, Java, NSIS, TypeScript, WiX, Xcode, and a variety of other tools. Qbs can build projects for many platforms including Android, FreeBSD, iOS, Linux, macOS, QNX, tvOS, watchOS, and Windows, with support for Universal Windows Platform applications, INTEGRITY, VxWorks, and other platforms under development. Qt Creator provides built-in Qbs support, and IDE integration for Visual Studio is provided by the generators feature. Support for Xcode is currently under development.
Build process
The build process in Qbs takes place in two stages. First, the build graph is resolved by reading the project's configuration files and computing the set of input and output nodes and the dependencies between them in a directed acyclic graph. Then the executor executes all of the commands necessary to create the output files, in parallel according to the dependency rules. Each build project contains a single build graph file in the directory where Qbs stores the serialized representation of its internal build graph format. Deserializing this file and utilizing the cached information allows Qbs to very quickly resolve the project, leading to near-instant incremental builds. Deleting the build graph file causes a complete rebuild of the entire project. In contrast to make, Qbs does not rely on timestamps of files in the build directory, and tampering with its contents will not lead to targets being rebuilt unless the—check-outputs option is used. This is done for performance reasons because on some platforms, reading timestamps from the filesystem is very slow compared to reading them from the build graph file.
Example Qbs file
CppApplication
History
Qbs development began at Nokia in the year 2010 in response to the need for a replacement for qmake. Qbs' design aims to provide a much lower learning curve, better integration with IDEs, and a stable and powerful language with predictable behavior. Qbs 1.0 was released in 2013 and further developed by the Qt Project beginning around that time. It was deprecated in favor of qmake and/or cmake, as of October 2018. In an August 7 2019 blog post, the Qt Company stated that starting with Qt 6, cmake will become Qt's standard build system. Qbs development was taken over by external volunteers, who as of June 2020 are still actively maintaining it.