Home · Editor · Code Navigation · Shortcuts · Wiki

[Previous: CMake Support in Qt Creator] [Qt Creator Manual] [Next: External Libraries]

Support for Generic Projects in Qt Creator

Since Qt Creator 1.1, generic projects are supported in addition to qmake projects. In other words, you can import existing projects that do not use qmake or CMake and Qt Creator ignores your build system.

This feature lets you use Qt Creator as a code editor. You can change the way your project is built by modifying the make command under Build Settings in the Projects mode.

For a generic project, you have to manually specify which files belong to your project and which include directories/defines you want to pass to your compiler.

Specifying Files

The list of files for a generic project is specified in the .files file. When you first create a generic project, Qt Creator adds any files it recognizes to your project. To add or remove files later, edit the .files file in Qt Creator. Your project tree is refreshed when you save this file. You can also add or remove files from the context menu in the project tree.

If you frequently need to update the .files file, we recommend the use of a small script that updates the files for you. If the file is modified externally, Qt Creator must be restarted for the changes to take effect.

Specifying Include Paths

The include paths are specified in the .includes file, one include path per line. The paths can be either absolute or relative to the .includes file.

Specifying Defines

The defines are specified in the .config file. This file is a regular C++ file, prepended to all your source files when they are being parsed. However, you should only use it to add lines like the following:

    #define NAME value

Creating a Run Configuration

Qt Creator cannot automatically determine which executable it should run. To set up a custom executable run configuration in the Projects mode, use the Add button. Here you can specify the name, executable, and some optional arguments. By default, the working directory is $BUILDDIR which should work fine.

[Previous: CMake Support in Qt Creator] [Qt Creator Manual] [Next: External Libraries]


Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Creator 1.3.0