title: Inherit include directories from used library in CMake
body: <p><strong>If I have a library with public header files which are used by another library's public header files how can I expose the former library's public header directory to a third application which depends only from the latter library <em>without explicitly adding the former library's header files' path to the application's target_include_directories section</em>?</strong></p>
  
  <p>I know this is a bit confusing, here is a simple example:</p>
  
  <p>I have two shared libraries and one application in the same cmake project:</p>
  
  <ul>
  <li><code>library_foo</code> has a directory which contains its public header files</li>
  <li><code>library_bar</code> has also a directory with its public header files. One of these public header files (<code>lib_bar/bar.h</code>) contains an <code>#include &lt;lib_foo/foo.h&gt;</code> entry, i.e. the public header file has a reference to a public header file defined in <code>library_foo</code>.</li>
  <li><code>library_bar</code> implementation depends on <code>library_foo</code>.</li>
  <li><code>app</code> depends <strong>directly</strong> only on the <code>library_bar</code>.</li>
  <li><code>app</code>'s <code>main.cpp</code> contains an <code>#include &lt;lib_bar/bar.h&gt;</code>.</li>
  </ul>
  
  <p>So, app depends <strong>indirectly</strong> from <code>library_foo</code> and its header files as well.</p>
  
  <p>I would like to write three CMakeLists.txt files for these three parts of my application. In the CMakeLists.txt of <code>app</code> I would like to specify dependency only to <code>library_bar</code>, i.e. the library and header dependecies from <code>libarary_foo</code> which are specified in <code>library_bar</code> CMakeLists.txt must be transferred to <code>app</code>. How can I do this? I would like to use <code>target_*</code> solution.</p>