PDA

View Full Version : Adding custom defines when on debug build



chus
2nd March 2007, 11:25
Hello,

I would like to pass custom #define's to the compiler when i make a debug build of my program

In my qmake file I have defined CONFIG var to be able of generating release and debug builds

CONFIG += debug_and_release
so when in command line i write
$>make debug
the builded application will have debug features, but I also need to define my custom defines to control the display my own debug messages when on debug or release.

For example:
#ifdef DEBUG_VAR
// the code of the debug message
#else
// do nothing
#endif

I would like to know also if qmake adds some useful defines for this case to the compiler

Thanks in advance!

wysota
2nd March 2007, 11:33
No, but you can add:

debug:DEFINES += DEBUG_VAR
to your project file.

jacek
2nd March 2007, 11:38
http://www.qtcentre.org/forum/f-qt-programming-2/t-qt-project-how-to--5464.html