Qt Creator Documentation

Specifying Build Settings

Different build configurations allow you to quickly switch between different build settings. By default, Qt Creator creates debug and release build configurations. A debug build contains additional debug symbols that you need for debugging the application but that you can leave out from the release version. Generally, you use the debug configuration for testing and the release configuration for creating the final installation file.

You specify build settings in the Projects mode.

To add a new build configuration, click Add and select the type of configuration you would like to add. You can add as many build configurations as you need.

To delete the build configuration currently selected, click Remove.

Editing Build Configurations

To edit a build configuration:

  1. Select the build configuration you want to edit in Edit Build Configuration.
  2. In section General, you can specify:
    • The Qt version you want to use to build your project. For more information, see Selecting the Qt version.
    • The tool chain required to build the project.

      Note: Only tool chains that are compatible with the selected Qt version are available.

    • By default, projects are built in a separate directory from the source directory, as shadow builds. This keeps the files generated for each target platform separate.

      Note: Shadow building is not supported by the Symbian build system. Also, shadow building on Windows is not supported for Maemo. If you only build for one target platform, you can deselect the Shadow build checkbox.

Note: The build configuration for the Symbian Device target uses the GCCE tool chain by default. If you want to build for the device using RVCT, install the RVCT tool chain, and then select it in the Tool chain field.

Build Steps

The build system of Qt Creator is built on qmake and make. In Build Steps you can change the settings for qmake and make. Qt Creator runs the make command using the Qt version defined for the current build configuration.

"Build steps"

You can use any environment variables as values in the fields. For a list of variable names, click Build Environment > Details. You can specify variables as ${VARNAME} or %VARNAME%. For example, ${BUILDDIR} or %BUILDDIR%.

Adding Custom Build Steps

To add custom steps to the build settings, select Add Build Step > Custom Process Step.

By default, custom steps are disabled. To activate a custom step, select the Enable custom process step check-box.

"Custom Process Step"

Note: Qt Creator sets SOURCEDIR and BUILDDIR as part of the build environment. For more information, see Build Environment.

Clean Steps

You can use the cleaning process to remove intermediate files. This process might help you to fix obscure issues during the process of building a project.

"Clean steps"

You can define the cleaning steps for your builds in the Clean Steps:

  • To add a clean step using make or a custom process, click Add Clean Step and select the type of step you want to add.

    By default, custom steps are disabled. To activate a custom step, select the Enable custom process step check-box.

  • To remove a clean step, click Remove Item.
  • To change the order of steps, click .

Build Environment

You can specify the environment you want to use for building in the Build Environment section. By default, the environment in which Qt Creator was started is used and modified to include the Qt version. Depending on the selected Qt version, Qt Creator automatically sets the necessary environment variables. You can edit existing environment variables or add, reset and unset new variables based on your project requirements.

"Build Environment"

Clearing the System Environment

To build with a clean system environment, select the Clear system environment check box. Qt Creator discards the current environment, and populates a clean system environment with the environment variables that the compilers and tools need. Therefore, the environment is never totally empty, even after you clear it.

[Previous: Running Applications on Multiple Targets] [Next: Specifying Run Settings]

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

s.parentNode.insertBefore(ga, s); })(); -->