title: Managing a project with header-only libs in Qt
body: <p>Right now I am having a project which uses a templated, hence header-only, library, and builds two apps.</p>
  
  <p>My folder organisation is as follows : </p>
  
  <pre><code>base/lib
  base/app1
  base/app2
  </code></pre>
  
  <p>What I do right now is that I have <code>base/lib/lib.pri</code> which looks like : </p>
  
  <pre><code>HEADERS += ../lib/someHeader.h
  </code></pre>
  
  <p>And I include it in <code>base/app1/app1.pro</code> and <code>base/app2/app2.pro</code>.</p>
  
  <p>However, in QtCreator, it looks somewhat ugly, for two reasons : </p>
  
  <ul>
  <li>The path in the <code>.pri</code> file depends on where it is included from. For instance, if I had another app that for some reason I wanted to be in folder <code>anotherBase/app3/</code> it would not work.</li>
  <li>On the project tree it looks like : </li>
  </ul>
  
  <p>(looks like I have to put text after a list in order to have code pretty-print)</p>
  
  <pre><code>app1
    -&gt; app1.pro
    -&gt; headers
    -&gt; source files
    -&gt; lib/
         -&gt; lib.pri
         -&gt; headers
             -&gt; someHeader.h
  app2
    -&gt; app2.pro
    -&gt; headers
    -&gt; source files
    -&gt; lib/
         -&gt; lib.pri
         -&gt; headers
             -&gt; someHeader.h
  </code></pre>
  
  <p>Hence I have two times the library files in the tree view.</p>
  
  <p>Is there any way to optimize this ? I would like to have :</p>
  
  <pre><code>app1
    -&gt; app1.pro
    -&gt; headers
    -&gt; source files
  app2
    -&gt; app2.pro
    -&gt; headers
    -&gt; source files
  lib
    -&gt; lib.pri
    -&gt; headers
  </code></pre>
  
  <p>in the tree view, however if I assing a <code>.pro</code> to <code>lib</code> and make it its own project, then when I want to compile everything it will complain that there is nothing to compile for lib and make an error...</p>
  
  <p>Thanks! </p>