Results 1 to 3 of 3

Thread: Adding custom defines when on debug build

  1. #1
    Join Date
    Mar 2006
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Adding custom defines when on debug build

    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!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Adding custom defines when on debug build

    No, but you can add:
    Qt Code:
    1. debug:DEFINES += DEBUG_VAR
    To copy to clipboard, switch view to plain text mode 
    to your project file.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adding custom defines when on debug build


Similar Threads

  1. How to build in debug mode?
    By Weilor in forum Newbie
    Replies: 5
    Last Post: 15th February 2006, 14:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.