title: Modular C++ Project Build with CMake
body: <p>I'm trying to find a way to build a big modular C++ project with CMake.</p>
  
  <p>The structure of the project is the following:</p>
  
  <pre><code>--project_root
    --src
  
      --folder_1
        --source_1.h
        --source_1.cc
        --test_source_1.cc // file containing a main with unit tests
  
      --folder_2
        --source_2.h
        --source_2.cc
        --test_source_2.cc // file containing a main with unit tests
  
      --folder_3
  
        ...
  </code></pre>
  
  <p>And so on.</p>
  
  <p>Each folder represent a project module and each module might depend on other modules, so for example source_1.h may include source_2.h.
  Every module folder may also contains a test file so the whole project will have multiple executables.</p>
  
  <p>How can I build the whole project with CMake? How should I write my CMakeLists.txt file?</p>
  
  <p>Thank you a lot.</p>