tags:

views:

274

answers:

1

When I build Qt applications on Ubuntu it puts the output files in the main solution folder as opposed to release/debug folders as it does on Windows.

This is problematic because sometimes the output files need to be run as part of the build process (for example to run unit tests).

I have an idea this has something to do with the qmake.conf files but I'm unsure what to do about it.

So my questions are:

  1. Why does this difference exist (could it just be me?)
  2. How should I go about making sure my applications will build correctly on both Windows and Ubuntu?
+3  A: 

I assume you're using qmake to do the actual building. You can edit the project files to put the output in different directories like this:

# only for unix:
unix {
    # in debug mode...
    CONFIG(debug, debug|release) {
        DESTDIR = debug
    }
    else {
        DESTDIR = release
    }
}

Obviously in order for this to work you need to be building both debug and release executables. More information on this topic can be found here

Cheers

Thomi