title: CMAKE linking to system library
body: <p>We would like to build a shared library with <code>CMAKE</code> system. It's something like:</p>
  
  <pre><code>lib/
    CMakeLists.txt
    src/
      CMakeLists.txt
      module/
        CMakeLists.txt
        module1.c
      foo.c
  </code></pre>
  
  <p><code>module1.c</code> needs some standard shared library like <code>librt</code>. We have</p>
  
  <pre><code>add_library(module module1.c)
  target_link_libraries(module rt)
  </code></pre>
  
  <p>in the <code>module/</code> sub-directory. But still getting errors that stuff from <code>librt</code> is not known.</p>