title: Cmake: target_link_libraries propagation of include directories
body: <p>I have a small static library that requires boost headers and that requires the "include" directory in the include directories.</p>
  
  <pre><code>...
  add_library(alib STATIC ...)
  target_include_directories(alib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
  target_include_directories(alib PRIVATE ${Boost_INCLUDE_DIRS})
  ...
  </code></pre>
  
  <p>I have another installation on the system of <em>alib</em>, exactly where ${Boost_INCLUDE_DIRS} point to, but this is an older version, required by other packages of my system. 
  The point is that I want to build a custom version of <em>alib</em> as a target of my project. So this is very important that nothing from the system <em>alib</em> is being included or linked against.</p>
  
  <p>Now I have another library <em>mylib</em> that depends on <em>alib</em>, so I do the following:</p>
  
  <pre><code>...
  add_library(mylib STATIC ...)
  target_link_libraries(mylib PUBLIC alib)
  target_include_directories(mylib PRIVATE ${EXPAT_INCLUDE_DIRS})
  ...
  </code></pre>
  
  <p>The <code>target_link_libraries(mylib PUBLIC alib)</code> call properly add includes from <em>alib</em> but it includes them AFTER the includes specified by the second line <code>target_include_directories(mylib PRIVATE ${EXPAT_INCLUDE_DIRS})</code>, even though they are specified afterwards. </p>
  
  <p>Problem is that <code>${EXPAT_INCLUDE_DIRS}</code> points to the include path where the system <em>alib</em> is located.</p>
  
  <p>It shouldn't matter if Cmake would correctly append include directories in the order they are provided, that is, the ones of <code>target_link_libraries(mylib PUBLIC alib)</code>then the ones of <code>target_include_directories(mylib PRIVATE ${EXPAT_INCLUDE_DIRS})</code>. </p>
  
  <p>However cmake does not respect this order and appends the include directories from the call of target_link_libraries in the end of the command line, resulting in the system headers being picked up instead of my <em>alib</em> version headers.</p>
  
  <p>I cannot change the name of directories of <em>alib</em> in any way.
  My current solution is to hack a custom call to target_include_directories by referencing the <em>alib</em> target manually:</p>
  
  <pre><code>target_include_directories(mylib PUBLIC $&lt;TARGET_PROPERTY:alib,INCLUDE_DIRECTORIES&gt;)
  </code></pre>
  
  <p>Is there a better way of doing so? How can I force Cmake to include directories of <em>alib</em> <strong>right-away</strong> in the <code>target_link_directories</code> call, and not after ?</p>