title: cmake: add_subdirectory() vs include()
body: <p>Let's say I have a C++ unit-test project using cmake like this:</p>
  
  <pre><code>$ tree
  .
  ├── C-API-ConditionVariable-unit-test
  │   ├── C-API-ConditionVariable-compile-link-test.c
  │   ├── C-API-ConditionVariable-unit-test-0.cpp
  │   └── C-API-ConditionVariable-unit-test-1.cpp
  ├── C-API-Mutex-unit-test
  │   ├── C-API-Mutex-compile-link-test.c
  │   ├── C-API-Mutex-unit-test-0.cpp
  │   └── C-API-Mutex-unit-test-1.cpp
  ├── some
  │   └── deeply
  │       └── nested
  │           └── path
  │               └── SomeFeature-unit-test
  │                   ├── SomeFeature-compile-link-test.c
  │                   ├── SomeFeature-unit-test-0.cpp
  │                   └── SomeFeature-unit-test-1.cpp
  └── CMakeLists.txt
  </code></pre>
  
  <p>Each source file from the subfolders creates a separate executable. I would like to have each subfolder in the project to be a non-standalone module - that is each subfolder is (more-or-less) self-contained, but is NOT a standalone cmake project which can be compiled separately. I would like to be able to only build everything or nothing. For example I don't want to make an impression that you could run cmake only from <code>some/deeply/nested/path/SomeFeature-unit-test</code> to build only that.</p>
  
  <p>Which option should I choose?</p>
  
  <ol>
  <li><code>CMakeLists.txt</code> file in each subfolder + <code>add_subdirectory()</code> in top-level <code>CmakeLists.txt</code>;</li>
  <li><code>some-random-name.cmake</code> in each subfolder + <code>include()</code> in top-level <code>CmakeLists.txt</code>;</li>
  <li>ignore my idea for each subfolder to be self-contained and put all relevant build info in the top-level <code>CMakeLists.txt</code>, additional cmake files only as helpers (macros, functions, ...);</li>
  </ol>
  
  <p>The first option is the most convenient, but it suggests that each subfolder is actually a standalone project which could be compiled separately.</p>
  
  <p>The second option seems to clearly suggest that there is only one cmake project here. But then in each <code>some-random-name.cmake</code> in subfolders I have to use full path to source files, which is against my desire for each of them to be self contained. If there's only one level of nesting (like for first two example subfolders) it is ok, but for <code>some/deeply/nested/path/SomeFeature-unit-test</code> this is not so nice. I would also have to prefix the names of output files.</p>
  
  <p>The third option seems like an easy way to quickly create a <code>CMakeLists.txt</code> file with a length of a spaghetti, so it possible I would prefer something else.</p>
  
  <p>I would like know which is the "preferred" way in a "modern" cmake project. All the tutorials I could find for multi-directory project deal with the case when there's a standalone library in one folder, standalone application using that library in another folder and standalone tests using the same library in yet another directory. Looking at projects using cmake I see no consistency, so this doesn't help much.</p>
  
  <p>(I'm a cmake noob, trying to convert a relatively large project to use cmake)</p>