32

I already have a project with a .pro file that can be built in debug and release mode. So my question is what is the options on the commandline that I have to specify if I want to build my binaries with debug information. Here is an example building in release using a bash script:

cd ${CHECKOUT_DIR_DEV_OGL_DX_ENGINE_SKIA};
echo `date`: "Running \`qmake\` on Skia";
qmake&>${SKIA_LOG};
buildstatus $? "Running \`qmake\` on Skia";
echo `date`: "Running \`make\` on Skia";
make&>${SKIA_LOG};
buildstatus $? "Running \`make\` on Skia Please see ${SKIA_LOG}";

What do I need to add to get it now to also build in debug mode?

Matthew Hoggan
  • 7,402
  • 16
  • 75
  • 140

1 Answers1

56

The option you need is "CONFIG+=debug". See General Configuration in qmake Manual.

#!/bin/bash
qmake CONFIG+=debug ${qmake_options}
make ${make_options}
Trevor Boyd Smith
  • 18,164
  • 32
  • 127
  • 177
Bill
  • 11,595
  • 6
  • 44
  • 52
  • 1
    I thought that was only to be used in the project file. I have CONFIG+=debug_and_release, which allows me to build both using QtCreator. However since my build process is automated I can't use QtCreator. Do you know if passing this on the command line will build in debug mode? – Matthew Hoggan Jan 21 '12 at 18:12