# Changing release and debug build folders of a Qt application

**URL:** <https://linux-tips.com/t/changing-release-and-debug-build-folders-of-a-qt-application/274>\
**Category:** Programming\
**Created:** [September 6, 2015, 3:20pm UTC](https://linux-tips.com/t/changing-release-and-debug-build-folders-of-a-qt-application/274 "2015-09-06T15:20:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RaskoX](https://linux-tips.com/user_avatar/linux-tips.com/raskox/32/92_2.png) [@RaskoX](https://linux-tips.com/u/RaskoX)\
**Post date:** [September 6, 2015, 3:20pm UTC](https://linux-tips.com/t/changing-release-and-debug-build-folders-of-a-qt-application/274/1 "2015-09-06T15:20:34Z")

</div>

I’m using QtCreator as an IDE for Qt based projects. Generally I’m happy with it, but default project build settings are somewhat different from my expectations.

QtCreator, creates separate build directories for _Debug_ and _Release_ configuration in parent directory of the project. For example if your project name is libAAA, it will create following folders in parent directory:

- build-libAAA-Desktop-Debug
- build-libAAA-Desktop-Release

I want to make Release builds in the same directory where the sources codes living and Debug builds must be a new Debug subfolder.

How can I make this changes within project’s `.pro` file?

---

<div class="post-metadata">

**Author:** ![DrSlump](https://linux-tips.com/user_avatar/linux-tips.com/drslump/32/61_2.png) [@DrSlump](https://linux-tips.com/u/DrSlump)\
**Post date:** [September 6, 2015, 3:26pm UTC](https://linux-tips.com/t/changing-release-and-debug-build-folders-of-a-qt-application/274/2 "2015-09-06T15:26:20Z")

</div>

You can use following settings in your `.pro` file:

```
CONFIG(release, debug|release){
    DESTDIR = ./
    OBJECTS_DIR = .obj
    MOC_DIR = .moc
    RCC_DIR = .rcc
    UI_DIR = .ui
}

CONFIG(debug, debug|release){
    DESTDIR = ./debug
    OBJECTS_DIR = debug/.obj
    MOC_DIR = debug/.moc
    RCC_DIR = debug/.rcc
    UI_DIR = debug/.ui
}

```

With above configuration, output of the release builds will remain in the source code directory. All the generated temprorary object codes will be in `.obj`, `.moc`, `.rcc` and `.ui` hidden directories.

Debug builds are also have similar folders with the difference of `debug` subfolder.
