title: Set linker search path for build in CMake
body: <p>It seems this question has been asked very often before but none of the solutions seem to apply in my case.</p>
  
  <p>I'm in a CMake/Linux environment and have to run an executable binary during the <strong>build</strong> step (<code>protoc</code> in particular).</p>
  
  <p>This binary needs a library but it's <strong>not installed</strong> (and cannot be) in the in the standard directories like <code>/usr</code>, so the library cannot be found.</p>
  
  <p>Unfortunately I cannot manipulate the <code>protoc</code> call because it's embedded in a 3rd party script.</p>
  
  <p>I can now set <code>LD_LIBRARY_PATH</code> before every <code>make</code> or set it system wide but this is very inconvenient especially when it comes to IDEs in which the build takes place or distributed build scenarios with continuous build environments.</p>
  
  <p>I tried to set <code>LD_LIBRARY_PATH</code> via </p>
  
  <pre><code>set(ENV{LD_LIBRARY_PATH} "/path/to/library/dir")
  </code></pre>
  
  <p>but this seems to have no effect during the build step.</p>
  
  <p>So my question is: can I set a library search path in CMake which is used during the build?</p>