Results 1 to 3 of 3

Thread: qmake CONFIG variable - how to retrieve one value

  1. #1
    Join Date
    Nov 2009
    Location
    US, Midwest
    Posts
    215
    Thanks
    62
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default qmake CONFIG variable - how to retrieve one value

    I want to retrieve the value of one of the CONFIG parameters that is added (debug or release) to use in directory construction.
    For example, I am using TARGET as:

    Qt Code:
    1. MOC_DIR += $${SolutionDir}/Build/Debug/tempFiles/$$TARGET/mocfiles
    To copy to clipboard, switch view to plain text mode 

    I'd like to replace Debug with the value added to the config, so it would look like
    Qt Code:
    1. MOC_DIR += $${SolutionDir}/Build/$$CONFIG/tempFiles/$$TARGET/mocfiles
    To copy to clipboard, switch view to plain text mode 

    What is the best approach? Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qmake CONFIG variable - how to retrieve one value

    Maybe one of the solutions from here? http://stackoverflow.com/questions/2...qmake-pro-file

    Cheers,
    _

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

    TorAn (11th March 2014)

  4. #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: qmake CONFIG variable - how to retrieve one value

    As noted in the link provided by anda_skoa, CONFIG values are typically used with scopes (see Scopes and Conditions in the qmake Advanced Usage section of the qmake manual). Or the CONFIG function (see qmake Function Reference) is used to test for presence of value in the CONFIG list; an optional second paramter can be used to specify the active config (details in the manual).

    More generally, any variable may be tested with the contains(variablename, value) function for the presence of a specified vallue. In this way the value is "retrieved" from a list variable.

Similar Threads

  1. Replies: 2
    Last Post: 16th February 2012, 11:43
  2. qmake | .pro and -config
    By migel in forum Newbie
    Replies: 2
    Last Post: 4th February 2012, 22:50
  3. QMAKE custom DEFINES & CONFIG
    By sheeeng in forum Qt Programming
    Replies: 16
    Last Post: 12th January 2012, 17:04
  4. qmake and CONFIG copy_dir_files
    By Vanir in forum Qt Programming
    Replies: 0
    Last Post: 25th February 2008, 15:56
  5. basic problem of config qmake
    By Shuchi Agrawal in forum Qt Tools
    Replies: 10
    Last Post: 10th January 2007, 10: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.