Results 1 to 4 of 4

Thread: how do I set the PREFIX inside the project file?

  1. #1
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Thanks
    129
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question how do I set the PREFIX inside the project file?

    Hello
    I am building a project and I need to set the PREFIX of the installation root inside the project file.
    I tried:
    Qt Code:
    1. PREFIX = /usr/local
    To copy to clipboard, switch view to plain text mode 
    but when I run
    Qt Code:
    1. qmake *.pro
    To copy to clipboard, switch view to plain text mode 
    it didn't output errors but there wasn't the word 'PREFIX' inside the makefile!
    So, I assume that im doing something wrong?
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

  2. #2
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Thanks
    129
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how do I set the PREFIX inside the project file?

    Sorry for this, it's not a bump. I figured it out, it is
    Qt Code:
    1. DEFINES +="PREFIX=\"/usr/local\""
    To copy to clipboard, switch view to plain text mode 
    BUT I don't know how to use it inside my program!
    For example:
    Qt Code:
    1. cout << PREFIX;
    To copy to clipboard, switch view to plain text mode 
    gives error
    Qt Code:
    1. /usr/local was not declared in this scope
    To copy to clipboard, switch view to plain text mode 
    and when I use:
    Qt Code:
    1. cout << "PREFIX";
    To copy to clipboard, switch view to plain text mode 
    of course it outputs
    Qt Code:
    1. PREFIX
    To copy to clipboard, switch view to plain text mode 

    I don't know what to do :/
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

  3. #3
    Join Date
    Dec 2008
    Location
    France
    Posts
    93
    Thanked 23 Times in 22 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: how do I set the PREFIX inside the project file?

    Try
    Qt Code:
    1. DEFINES +="PREFIX=\\\"/usr/local\\\""
    To copy to clipboard, switch view to plain text mode 

  4. The following user says thank you to nix for this useful post:

    hakermania (19th August 2011)

  5. #4
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Thanks
    129
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how do I set the PREFIX inside the project file?

    good one!!!!!!!!!!!!!!!
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

Similar Threads

  1. QWidget inside MFC project
    By hINTModuleState in forum Newbie
    Replies: 3
    Last Post: 9th October 2015, 15:22
  2. Play an FLV file inside an offline Qt App.
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 27th March 2011, 23:01
  3. Replies: 3
    Last Post: 3rd August 2010, 13:12
  4. How to check in c app what has been it's installation prefix?
    By pielas in forum General Programming
    Replies: 2
    Last Post: 14th July 2010, 09:19
  5. Replies: 1
    Last Post: 3rd December 2009, 23:34

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.