Results 1 to 3 of 3

Thread: qmake conditionals/arguments

  1. #1
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default qmake conditionals/arguments

    Is it possible to create a .pro file that exposes configuration options.

    Example:

    Qt Code:
    1. qmake --enable-my-super-fantastic-features
    To copy to clipboard, switch view to plain text mode 

    I know I can set variables. So if the above is not possible, I can follow that path.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: qmake conditionals/arguments

    EDIT: Ehm, forget about that, you havn't asked how to deal with variables!

    I never have seen such custom configuration options. At least I can't remember. But for Variables you can write
    qmake Code:
    1. qmake "DEFINES += MYFEATURE"
    To copy to clipboard, switch view to plain text mode 
    then you can check it in your pro file with
    qmake Code:
    1. contains( DEFINES, MYFEATURE ) {}
    To copy to clipboard, switch view to plain text mode 
    and you can use it right in your files
    Qt Code:
    1. #ifdef MYFEATURE
    2. /*...*/
    3. #endif
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: qmake conditionals/arguments

    Yes, I think I'll follow that route.
    Thanks.

Similar Threads

  1. Qtscript - corrupted arguments
    By starlon in forum Qt Programming
    Replies: 0
    Last Post: 23rd December 2009, 08:01
  2. slot with variable arguments
    By kung-foo in forum Qt Programming
    Replies: 1
    Last Post: 25th November 2009, 19:24
  3. QProcess error Using Arguments Qt 4.5
    By xanders in forum Qt Programming
    Replies: 6
    Last Post: 15th May 2009, 15:56
  4. Function arguments - how to get a reference
    By olidem in forum Qt Programming
    Replies: 2
    Last Post: 3rd March 2009, 10:31
  5. QVector arguments
    By phillip_Qt in forum Qt Programming
    Replies: 2
    Last Post: 4th December 2007, 10:47

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.