Results 1 to 3 of 3

Thread: conditions in pro files

  1. #1
    Join Date
    Jun 2008
    Posts
    57
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default conditions in pro files

    Hello!
    I have Qt SDK 1.1 (installed with online installer) on Windows + MinGW.
    And I have a few misunderstandings with *.pro files usage.
    1. When I use this:
    Qt Code:
    1. CONFIG(release, debug|release) {
    2. message("in release")
    3. } else {
    4. message("in debug")
    5. }
    To copy to clipboard, switch view to plain text mode 

    and compile in release mode, I get the following output:
    Project MESSAGE: in release
    Project MESSAGE: in release
    Project MESSAGE: in debug
    Why do I get 3 messages instead of 1? why they are different?
    When I compile in debug mode, I get the following output:
    Project MESSAGE: in debug
    Project MESSAGE: in debug
    Project MESSAGE: in release
    2. From the documentation about CONFIG variable:
    “Since the debug option overrides the release option when both are defined in the CONFIG variable…”
    is it really true?
    3. If I use the syntax
    Qt Code:
    1. <condition> {
    2. <command or definition>
    3. }
    To copy to clipboard, switch view to plain text mode 

    from what sources qmake finds out whether <condition> is true or false, besides CONFIG?

    4. About a year ago I read an article at qt.nokia.com that Qt software is considering migration to another build system (e.g. CMake) or developing its own. Are there any news in this area?
    Thanks in advance.
    Last edited by Radagast; 12th February 2011 at 10:15.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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: conditions in pro files

    You get three messages because something in the windows implementation of make or qmake is seriously screwed up. On Linux you'll get only one message.
    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.


  3. #3
    Join Date
    May 2010
    Posts
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11
    Wiki edits
    11

    Default Re: conditions in pro files

    For the record:

    Put "!build_pass:" before each use of the message function -

    ! builld_pass: message (One time message)

    - to avoid those annoying extra messages.

Similar Threads

  1. How use conditions in Qt .pro file
    By hubbobubbo in forum Qt Programming
    Replies: 4
    Last Post: 14th October 2013, 20:08
  2. Replies: 0
    Last Post: 1st December 2010, 21:21
  3. Replies: 3
    Last Post: 15th February 2010, 18:27
  4. Replies: 12
    Last Post: 17th June 2009, 06:34
  5. Low-level error conditions on QImage.load()
    By bruccutler in forum Newbie
    Replies: 3
    Last Post: 19th January 2007, 22:09

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.