What just happened?
How exactly was the project built? To see which kit and which build configuration was used, click on the icon in the action bar directly over the green triangle icon to open the build configuration popup, as shown in the following screenshot:
The exact content that you get varies depending on your installation, but in general, on the left, you will see the list of kits configured for the project and on the right, you will see the list of build configurations defined for that kit. You can click on these lists to quickly switch to a different kit or a different build configuration. If your project is configured only for one kit, the list of kits will not appear here.
What if you want to use another kit or change how exactly the project is built? As mentioned earlier, this is done in the Projects mode. If you go to this mode by pressing the Projects button on the left panel, Qt Creator will display the current build configuration, as shown in the following screenshot:
The left part of this window contains a list of all kits. Kits that are not configured to be used with this project are displayed in gray color. You can click on them to enable the kit for the current project. To disable a kit, choose the Disable Kit option in its context menu.
Under each enabled kit, there are two sections of the configuration. The Build section contains settings related to building the project:
- Shadow build is a build mode that places all temporary build files in a separate build directory. This allows you to keep the source directory clean and makes your source files easier to track (especially if you use a version control system). This mode is enabled by default.
- Build directory is the location of temporary build files (only if shadow build is enabled). Each build configuration of the project needs a separate build directory.
- The Build steps section displays commands that will be run to perform the actual building of the project. You can edit command-line arguments of the existing steps and add custom build steps. By default, the build process consists of two steps: qmake (Qt's project management tool described in the previous chapter) reads the project's .pro file and produces a makefile, and then some variation of make tool (depending on the platform) reads the makefile and executes Qt's special compilers, the C++ compiler, and the linker. For more information about qmake, look up the qmake Manual in the documentation index.
- The Build environment section allows you to view and change environment variables that will be available to the build tools.
There can be multiple build configurations for each kit. By default, three configurations are generated: Debug (required for the debugger to work properly), Profile (used for profiling), and Release (the build with more optimizations and no debug information).
The Run section determines how the executable produced by your project will be started. Here, you can change your program's command-line arguments, working directory, and environment variables. You can add multiple run configurations and switch between them using the same button that allows you to choose the current kit and build configuration.