title: g++ -I include all subdirectories with header files
body: <p>I've just stumbled upon <a href="https://stackoverflow.com/questions/33662375/how-can-you-compile-all-cpp-files-in-a-directory">this post</a> about compiling all .cpp files, including those in subdirectories using the linux <em>find</em> command:</p>
  <p><code>g++ -g $(find RootFolderName -type f -iregex &quot;.*\.cpp&quot;) -o OutputName</code></p>
  <p>The problem with this is that all files need their relative path written out when doing #include for this to work. You can get around it by adding what ever directory you need using the <code>-I</code> tag:</p>
  <p><code>g++ -g $(find RootFolderName -type f -iregex &quot;.*\.cpp&quot;) -o OutputName -I ./somePath</code></p>
  <p>But that's still quite a hassle if you have multiple subdirectories. Is it possible to use find again with some other regular expression to include all of the subdirectories?</p>