0
votes

This question has been asked before but the solutions assume that you are acquainted with OS X, unfortunately I'm not, so please bear with me. I would like to use qmake from the terminal command. With Yosemite, I'm not able to find an easy way to do it. The solution is suggested here but I can't figure out how to use it. The solution is as follows

In previous releases of OS X (Mavericks, Mountain Lion, Lion, ...), environment variables are configured in the /etc/launchd.conf file. As of OS X Yosemite, this is no longer working. To configure environment variables, you can do the following

$ nano ~/Library/LaunchAgents/my.startup.plist

my.startup.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>my.startup</string>
  <key>ProgramArguments</key>
  <array>
    <string>sh</string>
    <string>-c</string>
    <string>launchctl setenv $VARIABLE_NAME $VARIABLE_VALUE</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
</dict>
</plist>

In my case, the path to qmake is /Users/XXXX/Qt/5.4/clang_64/bin, what should I do so that the qmake will be recognized in the terminal command?

1
So you just want to be able to type qmake? I.e., you want to add the path to qmake to your PATH?deceze♦
@deceze, yes indeed.CroCo

1 Answers

2
votes

Terminal sessions use the shell. You only should modify shell environment variables, there is no need to reconfigure GUI programs.

Also, I don't suppose the .plist offers a way to extend a preexisting variable.

You could use ~/.profile:

export PATH=$PATH:~XXXX/Qt/5.4/clang_64/bin

If Qt offers a more canonical method of installation, that would probably be preferable, though.


If you literally just want the command qmake to work, without really installing anything, just do

sudo ln -s ~/Qt/5.4/clang_64/bin/qmake /usr/local/bin