Generate and Configure

5.1.1. Configure a project

You need to run this step before being able to build your project. This is usually run only once at the beginning of the first build process — for example, just after you have extracted a source tarball of a project distribution. After that, configuration is automatically handled by the subsequent build processes. If you have used the Application Wizard to create the application, then you will not need to run this separately: the wizard will run it as a part of the project generation process.

There is no requirement to run this only once. It can be run at any time, usually when the configuration options need to be changed. One thing to note is that if the config.h file in the top level directory is changed, running configure again will not overwrite it.

Both generate and configure steps are launched with a single menu item: Build ▸ Configure Project…. This menu item brings a dialog where you can choose:

  • Whether you want to run the generate step or not

    The generate step needs to be run once at the beginning of the project; then it is automatically handled by the build process. You can force it to run by checking the checkbox Regenerate project; you might do this if you encounter difficulties while building a project (e.g. if you receive build errors after you've modified lots of build files).

  • The configuration name

    This name is used to refer to each configuration. Some configurations (Default, Debug, Optimized) are already defined by default. One configuration includes a build directory and some configuration options.

  • The build directory

    This is the build directory name. In the Default configuration, it is the same directory as the source directory but autotools supports building in a different directory.

    Each configuration must have a different build directory and if one configuration uses the source directory, you cannot have other configurations at the same time. You need to run Build ▸ Remove Configuration on the configuration using the source directory before adding a new configuration.

  • Configure options

    These options are passed to the configure script. Some are standard, such as --prefix and CFLAGS; others depend on the project. You can get a list of allowed configuration options by running the configure script with the --help argument.

5.1.2. Select a configuration

If you have created different configurations, you can select which one is active by selecting it in Build ▸ Select Configuration.

5.1.3. Clean a configuration

To clean the project and leave it in a state that requires rerunning the configure step, choose Build ▸ Remove Configuration. It run make distclean and deletes more files than Clean Project. In other words, it leaves the project as though it has just been extracted from a distribution tarball. Note that it does not remove the configuration directory itself; you can do that yourself if you like.