Results 1 to 7 of 7

Thread: how to change default qmake path/version in mac os x?

  1. #1
    Join Date
    May 2011
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Question how to change default qmake path/version in mac os x?

    Hi every one,
    How can i change the default path of qmake? I already have it in:
    /opt/local/lib
    to a newly installed:
    /usr/local/trolltech/qt-4.7.3/bin
    but I want to change it to the newly installed version. (I don't have qt creator installed)
    I am using mac os x and new to Qt.
    Thanks,
    Abdol

    *** To add some explanation, I have 2 installations of Qt, the 2nd one is newer and I want to use the 2nd one by default, and when I type: qt -v in terminal see the 2nd path.
    Last edited by abdol; 26th May 2011 at 22:59.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: how to change default qmake path/version in mac os x?

    Set your system path to find the qmake from the new version of Qt before it finds the old version.

  3. #3
    Join Date
    May 2011
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: how to change default qmake path/version in mac os x?

    Sorry for the delay,
    Thank you for your reply
    When i search for qmake in:
    /opt/local/lib
    using terminal, i can't find it and indeed there is no such a file in this directory but why qmake is giving me this path? How can I resolve this?

    2nd, I am very new to mac os x, would you please explain what is the system path and how can I set it? can i use "setenv" command?

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: how to change default qmake path/version in mac os x?

    "qmake -v" reports where the Qt libraries are installed, not where qmake itself is installed. In your case qmake is probably in /opt/local/bin. Try this:
    Qt Code:
    1. $ qmake -v
    2. QMake version 2.01a
    3. Using Qt version 4.7.2 in /usr/lib/qt4
    4. $ which qmake
    5. /usr/bin/qmake
    To copy to clipboard, switch view to plain text mode 

    How to change your PATH (assumes sh not csh):
    http://www.tech-recipes.com/rx/2621/...ment_variable/
    for csh the command would be:
    Qt Code:
    1. setenv PATH "$PATH:/add/my/extra/path"
    To copy to clipboard, switch view to plain text mode 
    probably in ~/.cshrc

    There are some files in /etc/you can use to change the PATH globally:
    http://serverfault.com/questions/163...l-path-on-os-x

    For more specifics you will have to wait until someone that develops on Mac comes along.

  5. The following user says thank you to ChrisW67 for this useful post:

    abdol (7th June 2011)

  6. #5
    Join Date
    May 2011
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: how to change default qmake path/version in mac os x?

    I would like to share what I came to and I still need your help

    1. How to set global environments variables in mac os x:
    http://www.digitaledgesw.com/node/31
    http://serverfault.com/questions/163.../277034#277034
    http://stackoverflow.com/questions/1...iables-in-os-x

    2. How to change the PATH and order of its entries?
    http://www.softec.lu/site/Developers...gThePathHelper

    to change the variables in qmake i found this:
    http://doc.qt.nokia.com/4.7-snapshot...reference.html
    and set the variables to the directories which I have the current installation but there are still multiple entries and when I type qmake -v it is still using the first installation (which is not valid anymore).

    I also tried to add the path at the beginning of the PATH but there are still some paths at the beginning that i can not remove or change them.

    any idea or help is appreciated.
    Last edited by abdol; 8th June 2011 at 22:10. Reason: I will keep updating this post.

  7. #6
    Join Date
    May 2011
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: how to change default qmake path/version in mac os x?

    when I type qmake -query
    Qt Code:
    1. QT_INSTALL_BINS:/usr/local/Trolltech/Qt-4.7.3/bin
    2. QT_INSTALL_HEADERS:/usr/local/Trolltech/Qt-4.7.3/include
    3. QT_INSTALL_PREFIX:/usr/local/Trolltech/Qt-4.7.3
    4. QT_INSTALL_PREFIX:/opt/local
    5. QT_INSTALL_DATA:/opt/local/share/qt4
    6. QT_INSTALL_DOCS:/opt/local/share/doc/qt4
    7. QT_INSTALL_HEADERS:/opt/local/include
    8. QT_INSTALL_LIBS:/opt/local/lib
    9. QT_INSTALL_BINS:/opt/local/bin
    10. QT_INSTALL_PLUGINS:/opt/local/share/qt4/plugins
    11. QT_INSTALL_IMPORTS:/opt/local/share/qt4/imports
    12. QT_INSTALL_TRANSLATIONS:/opt/local/share/qt4/translations
    13. QT_INSTALL_CONFIGURATION:/opt/local/etc/qt4
    14. QT_INSTALL_EXAMPLES:/opt/local/share/qt4/examples
    15. QT_INSTALL_DEMOS:/opt/local/share/qt4/demos
    16. QMAKE_MKSPECS:/opt/local/share/qt4/mkspecs
    17. QMAKE_VERSION:2.01a
    18. QT_VERSION:4.7.3
    To copy to clipboard, switch view to plain text mode 

    and typing echo $PATH gives me:
    Qt Code:
    1. /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/Trolltech/Qt-4.7.3/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin
    To copy to clipboard, switch view to plain text mode 

  8. #7
    Join Date
    Apr 2012
    Posts
    13
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to change default qmake path/version in mac os x?

    If you can't get your path configured the way you want, you could always soft link from the original location of quake binary (for example /usr/bin) to the newer version. If you 'ls -al /usr/bin/q*' you will see that qmake is probably already a soft link.)

    Something like:

    cd /usr/bin
    sudo rm qmake
    sudo ln -s /Users/user/Qt/5.1.1/clang_64/bin/qmake qmake

    (You will need root permission.)

    In other words, the path will still find qmake in its original location, but it will refer to a quake executable in another location.
    Last edited by bootchk; 5th April 2014 at 16:10. Reason: ln args reversed

Similar Threads

  1. QSqlDatabase default MySQL unix socket path
    By daggilli in forum Qt Programming
    Replies: 0
    Last Post: 21st September 2008, 20:55
  2. Where does qmake get the qt path?
    By reimer in forum Installation and Deployment
    Replies: 6
    Last Post: 2nd August 2008, 08:54
  3. how do I get the default picture path of qtopia 2.2
    By pencilren in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 17th September 2007, 10:01
  4. qmake default includes
    By Gopala Krishna in forum Installation and Deployment
    Replies: 5
    Last Post: 17th July 2007, 21:47
  5. How to change Path
    By shyam prasad in forum Qt Programming
    Replies: 1
    Last Post: 10th January 2007, 09:29

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.