title: Install Qt 5.2.1 and make pkg-config to recognize it
body: <p>My OS (Ubuntu 12.04) comes with a pre-packaged Qt4 libraries and other relevant stuffs. But I wanted to use the latest vanilla <a href="http://qt-project.org/downloads" rel="noreferrer">Qt 5.2.1</a>, I have installed it and it's working fine, suppose I have compiled <a href="https://github.com/kipr/kiss" rel="noreferrer">this framework</a> which depends on Qt. </p>
  
  <p>What I had to do is to add the Qt 5.2.1 libraries to the <code>$LD_LIBRARY_PATH</code>. My Qt 5.2.1 home path is <code>/opt/Qt5.2.1/5.2.1/gcc_64</code>, and thus my <code>$LD_LIBRARY_PATH</code> contains <code>/opt/Qt5.2.1/5.2.1/gcc_64/lib</code> (and <code>/opt/Qt5.2.1/Tools/QtCreator/lib</code> for qtcreator related stuffs)</p>
  
  <p>However, recently I am trying to compile the latest gnu <a href="https://www.gnu.org/software/octave/download.html" rel="noreferrer">octave</a>. It's <code>configure</code> script looks for the Qt <code>cflags</code> (i.e. <code>-l</code>/<code>-I</code>/<code>-L</code> flags) by invoking the <code>pkg-config</code>. </p>
  
  <p>What I came to know that pkg-config looks for the appropriate <code>.pc</code> files to get the exact information related to all compilation/linking flags. My system (Ubuntu) maintains a list of all required <code>.pc</code> file locations in <code>/var/lib/dpkg/info/pkg-config.list</code>. <strong>But I do not have any <code>$PKG_CONFIG_PATH</code> environment variable on Ubuntu 12.04 (I am not sure why).</strong></p>
  
  <p>My newly installed Qt5 has a set of <code>.pc</code> files in <code>/opt/Qt5.2.1/5.2.1/gcc_64/lib/pkgconfig/</code>. </p>
  
  <p>So, <strong>how do I make pkg-config to recognize the development libraries in the newly installed Qt 5.2.1 ?</strong></p>
  
  <p>I know that this could be solved by just installing the Qt4 <code>-dev</code> packages from the Ubuntu repo, but I do not want to do that. I need the vanilla Qt 5.2.1 for other purposes.</p>
  
  <p><strong>NOTE:</strong> </p>
  
  <ul>
  <li>I have added the the path <code>/opt/Qt5.2.1/5.2.1/gcc_64/lib/pkgconfig/</code> to the pkg-config.list but the pkg-config does not update the compilation flags accordingly.</li>
  <li>Adding the path (<code>/opt/Qt5.2.1/5.2.1/gcc_64/lib/pkgconfig/</code>) to <code>$PKG_CONFIG_PATH</code> does not work as well.</li>
  </ul>
  
  <p>Here is the octave configure script <a href="http://pastebin.com/Z9B4hCF3" rel="noreferrer">output</a>.</p>