title: CMake to produce -L<path> -l<lib> link flags for static libraries
body: <p>I'm using CMake 2.8 in order to build an application based on MQX OS (using CodeWarrior).<br>
  The CMake project basically builds a set of static libraries (let's say LIB1 and LIB2).<br>
  I then reference these libraries in the final executable cmake rule:</p>
  
  <pre><code>target_add_executable(X ${some_sources})
  target_link_libraries(X LIB1 LIB2)
  </code></pre>
  
  <p>My problem is that some symbols are defined in more that one library.<br>
  Thus, a link command like:</p>
  
  <pre><code>mwldarm &lt;args&gt; -o &lt;output&gt; &lt;objects&gt; /path/to1/libLIB1.a /path/to2/libLIB2.a
  </code></pre>
  
  <p>would lead to multiple definition of symbols error.
  Instead, I would like CMake to generate a link command like:</p>
  
  <pre><code>mwldarm &lt;args&gt; -o &lt;output&gt; &lt;objects&gt; -L/path/to1 -L/path/to2 -lLIB -lLIB2
  </code></pre>
  
  <p><b>Question: How to get the following variables from CMAKE?</b></p>
  
  <ul>
  <li>Libraries directories flags (ex: <code> -L/path/to1 -L/path/to2</code>)</li>
  <li>Libraries link flags (ex: <code>-lLIB -lLIB2</code>)</li>
  </ul>
  
  <p>I've read stuff concerning RPATH but it seems to concern shared libraries only. Am I right?
  <br></p>
  
  <p>Thanks for advance.<br>
  I do appreciate.</p>