title: cmake glob include while preserving directory structure
body: <p>I'm new to <code>cmake</code> and I'm trying to install <code>.hpp</code> files while preserving directory structure.</p>
  
  <p>So far I have</p>
  
  <pre><code>FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp"
    "${CMAKE_CURRENT_SOURCE_DIR}/include/MyLib/*.hpp"
    "${CMAKE_CURRENT_SOURCE_DIR}/include/MyLib/detail/*.hpp"
  
  install (FILES ${files}  DESTINATION include)
  </code></pre>
  
  <p>All the files get found but the directory hierarchy is flattened.  </p>
  
  <p>FWIW The <code>bjam</code> command I'm trying to emulate is</p>
  
  <pre><code>install headers 
      : ../include/EnsembleLearning.hpp  
        [ glob ../include/MyLib/*.hpp ]  
        [ glob ../include/MyLib/detail/*.hpp ]  
      : &lt;install-source-root&gt;../include ;
  </code></pre>