title: How to set RPATH in CMAKE?
body: <p>I wish to build and install a software locally to the <code>$HOME/.local/</code> path instead of a system-wide <code>/usr/</code> folder. The software uses CMAKE for compilation.</p>
  <p>After installation, the software binaries and libraries get stored in <code>$HOME/.local/bin/</code> and <code>$HOME/.local/lib/</code>, respectively. However, when I try to run the program, it throws an error that the required library is not found (which, by the way, is present in <code>$HOME/.local/lib/</code>).</p>
  <p>The program works fine if I set the <code>$LD_LIBRARY_PATH</code> to <code>$HOME/.local/lib</code>. But I don't want to do this. Hence, instead of this, I would like to know how to specify the <code>RPATH</code> variable (which would point to <code>$HOME/.local/lib</code>) while compiling the software using CMAKE.</p>
  <p>Kindly help.</p>