Results 1 to 3 of 3

Thread: Qmake having different define preprocessor words per config

  1. #1
    Join Date
    Jun 2010
    Posts
    36
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Qmake having different define preprocessor words per config

    I started using qmake yesterday, and it was pretty easy. I could understand and do almost everything I needed.

    Now, normally in my eclipse projects I use two of my own preprocessor keywords to exclude "asserts" when doing a release build, and those are DEBUG and RELEASE.

    What bring me here is that I noticed I could do both builds by using "debug_and_release" on my "CONFIG", in that case how would I specify my different preprocessor defines for each build an a same .pro?

    Is it meant to have two .pro? in that case why is building debug and release in conjunction an option.

    Are there already any preprocessor keywords to differentiate if its a debug or a release build?
    Edit: SOLVED QT_DEBUG and QT_NO_DEBUG
    Last edited by toglia3d; 6th October 2010 at 19:25.

  2. #2
    Join Date
    Jun 2010
    Posts
    36
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qmake having different define preprocessor words per config

    Ok, so I discovered that QT_DEBUG and QT_NO_DEBUG where the preprocessor defines I was looking for, nevertheless my main question is still worth knowing.

    Thanks for any help.

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

    Default Re: Qmake having different define preprocessor words per config

    qmake Code:
    1. CONFIG(debug, debug|release): DEFINES += DEBUG
    2. CONFIG(release, debug|release): DEFINES += RELEASE
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. " #define " Where can i find words?
    By remnant24c@nate.com in forum Newbie
    Replies: 2
    Last Post: 8th April 2009, 04:17
  2. qmake and CONFIG copy_dir_files
    By Vanir in forum Qt Programming
    Replies: 0
    Last Post: 25th February 2008, 14:56
  3. Adding 3 words to Button with specified length betwwen words
    By chikkireddi in forum Qt Programming
    Replies: 1
    Last Post: 26th October 2007, 11:08
  4. basic problem of config qmake
    By Shuchi Agrawal in forum Qt Tools
    Replies: 10
    Last Post: 10th January 2007, 09:31
  5. Define compiler in qmake
    By philski in forum Newbie
    Replies: 3
    Last Post: 24th April 2006, 21:47

Tags for this Thread

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.