Results 1 to 4 of 4

Thread: Qmake variable

  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Qmake variable

    Hey folks,

    Is it possible to do something like that in a QMake .pro file:

    Qt Code:
    1. myVariable = ../qkit/include
    2.  
    3. INCLUDEPATH += $(myVariable)/qkCore
    To copy to clipboard, switch view to plain text mode 

    Thanks.

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qmake variable

    Yes, this is possible.
    similar like this.
    Qt Code:
    1. myvar = "any string value"
    2. othervar += myvar
    To copy to clipboard, switch view to plain text mode 
    Notice the quoted value and the use of variable without $$ sign.

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

    bunjee (29th July 2009)

  4. #3
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: Qmake variable

    Thanks,

    Solved:

    Qt Code:
    1. myVariable = "../qkit/include"
    2.  
    3. INCLUDEPATH += $$myVariable/qkCore
    To copy to clipboard, switch view to plain text mode 

  5. #4
    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: Qmake variable

    Single dollar sign means an evironment variable, double dollar sign means a qmake variable.
    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.


  6. The following user says thank you to wysota for this useful post:

    bunjee (29th July 2009)

Similar Threads

  1. qmake doesn't respect QMAKESPEC variable
    By piotr.dobrogost in forum Installation and Deployment
    Replies: 5
    Last Post: 19th July 2009, 22:08
  2. qmake sux a lot
    By singermornings in forum Qt Programming
    Replies: 6
    Last Post: 29th January 2009, 08:33
  3. qmake - how to extract number from variable
    By Vanir in forum Qt Programming
    Replies: 1
    Last Post: 12th January 2009, 18:12
  4. nmake error during .pro compiling
    By mattia in forum Installation and Deployment
    Replies: 5
    Last Post: 18th June 2008, 10:15
  5. MacOS settings
    By skaiser in forum Installation and Deployment
    Replies: 2
    Last Post: 19th July 2007, 07: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.