Results 1 to 3 of 3

Thread: qmake | .pro and -config

  1. #1
    Join Date
    Apr 2011
    Posts
    132
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default qmake | .pro and -config

    Thought specifying -config you can run the scoped code.

    Qt Code:
    1. debug {
    2. DEFINES += SD_DEV
    3. message("debug")
    4. }
    5.  
    6. release {
    7. message("release")
    8. }
    9.  
    10. qmake p.pro -config release
    11. Project MESSAGE: debug
    12. Project MESSAGE: release
    To copy to clipboard, switch view to plain text mode 

    Should I have only release message ?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: qmake | .pro and -config

    Both release and debug can be in CONFIG at the same time, and the last one wins (put CONFIG in a message to see the default). You want to use the CONFIG() function:
    Qt Code:
    1. CONFIG(debug, debug|release) {
    2. message("debug")
    3. }
    4.  
    5. CONFIG(release, debug|release) {
    6. message("release")
    7. }
    To copy to clipboard, switch view to plain text mode 
    and then:
    Qt Code:
    1. $ qmake test.pro
    2. Project MESSAGE: release
    3. $ qmake CONFIG+=debug test.pro
    4. Project MESSAGE: debug
    5. $ qmake CONFIG+=release test.pro
    6. Project MESSAGE: release
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to ChrisW67 for this useful post:

    migel (4th February 2012)

  4. #3
    Join Date
    Apr 2011
    Posts
    132
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qmake | .pro and -config

    yeah, thanks, I found that. I just don't understand purpose of running both. What is that for then ?

Similar Threads

  1. QMAKE custom DEFINES & CONFIG
    By sheeeng in forum Qt Programming
    Replies: 16
    Last Post: 12th January 2012, 16:04
  2. Replies: 0
    Last Post: 17th December 2010, 16:38
  3. Replies: 2
    Last Post: 7th October 2010, 02:05
  4. qmake and CONFIG copy_dir_files
    By Vanir in forum Qt Programming
    Replies: 0
    Last Post: 25th February 2008, 14:56
  5. basic problem of config qmake
    By Shuchi Agrawal in forum Qt Tools
    Replies: 10
    Last Post: 10th January 2007, 09:31

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.