title: Git repository layout for header-only C++ library?
body: <p>I want to organize a collection of C++ header files in a way that it is easy for me and others to include them in other projects.
  It should also be easy to merge changes in those projects to the original files.<br>
  For now, I have about 30 header files, about 20 files with unit tests and about 15 files with usage examples which are partly referenced in the Doxygen documentation.
  The code is mainly developed on Linux but should be platform-independent (at least theoretically).</p>
  
  <p>My initial idea of organizing the files would be this (suppose the name of the project is <code>xyz</code>):</p>
  
  <pre><code>xyz/
  xyz/examples/
  unit_tests/
  README
  </code></pre>
  
  <p>Then, the easiest way to use this in another project would be to copy the <code>xyz/</code> subdirectory to your own source directory and include the header files like this in your project:</p>
  
  <pre><code>#include "xyz/something.h"
  </code></pre>
  
  <p>One advantage of this would be that no paths need to be added in your build system, it should work without changes.</p>
  
  <p>A disadvantage of having the files in a subdirectory is that it's harder to use in <code>git submodule</code> and <code>git subtree</code>. Especially, <code>git subtree split</code> didn't work if only a subdirectory of a repository was used as subtree. (This, however, may become yet another SO question ...)</p>
  
  <p>I've looked at several other (header-only) repositories, and often they have their files in <code>include/</code>, <code>include/xyz/</code>, <code>src/</code> or simply in the root of the repository.</p>
  
  <p>What are your experiences, what would be your preferred layout?<br>
  What workflow would you suggest?<br>
  Would you use <code>git submodule</code> or <code>git subtree</code> or something completely different?</p>