title: How can I build a C++ project with multiple interdependent subdirectories?
body: <p>I have a C++ project where I've used directories as more of an organizational element -- the way one might use packages in Java or directories in PHP.  Directories are not intended to be self-sufficient elements, but rather just a way of organizing the whole of the project and keeping me from being overwhelmed by sources.  How can I construct my CMakeLists.txt files to deal with this?  Making the directories libraries doesn't seem to fit here, since they are all interdependent and not intended to be used that way.</p>
  
  <p>As a related issue, most of the examples I've seen of multiple subdirectories in CMake (and there aren't very many of those) have ignored or glossed over the issue of setting <code>include_directories</code>, which is something I've been having trouble with.  Short of combing my source files to determine which file depends on which and in what directory, is there anyway to just set all directories under <code>/src/</code> as potential include directories and let CMake work out which ones are actually dependent?  </p>
  
  <p>Here's an example structure:</p>
  
  <pre><code>--src
    --top1
      --mid1
        --bot1
          --src1.cpp
          --hdr1.h
        --bot2
          --src2.cpp
          --hdr2.h
      --mid2
        --bot3
          --src3.cpp
          --src4.cpp
          --hdr3.h
    --top2
      --mid3
        --src5.cpp
        --hdr4.h
  </code></pre>
  
  <p>So on and so forth.  How can I structure my <code>CMakeLists.txt</code> files to handle this sort of structure?</p>