I am building a .pro based Qt project using Qt creator. I really like Creator. But I am quite confused by the difference between setting the build in creator to debug/release and doing the same thing in the .pro file.

Ideally I just want to set debug or release builds in creator and not to have to change the .pro file.

If I put this in the .pro file:

Qt Code:
  1. CONFIG = qt warn_on resources uic
  2.  
  3. TEMPLATE = app
  4.  
  5. win32 {
  6. QMAKE_CXXFLAGS += -EHsc
  7. debug {
  8. QMAKE_CXXFLAGS += -Gm
  9. }
  10. release {
  11. QMAKE_CXXFLAGS += -Zi -GL
  12. }
  13. }
To copy to clipboard, switch view to plain text mode 

Then set the creator build to debug, it builds it with release setting (e.g. -O2). The build output is:

qmake.exe" D:\personal\asg\asg.pro -r -spec win32-msvc2010

I also tried:

qmake.exe" D:\personal\asg\asg.pro -r -spec win32-msvc2010 "CONFIG+=debug"

But it didn't seem to make any difference.

I can only seem to get it to do what I want by setting "CONFIG=debug" in both the .pro file and the creator build. This makes changing between debug and release builds tedious.

I have had a look through the qmake and creator documentation, but I couldn't find anything useful. I'm sure there must be a straightforward answer.