title: CMake nested libraries
body: <p>I have a Project in c++ where my <code>executable</code> depends on my <code>core library</code> and that library depends on another external library, <code>libtorrent</code> if it is of any relevance.</p>
  
  <p>The problem is I can not figure out how to setup my CMakeLists.txt, I have been searching for days now, without avail.</p>
  
  <p>The main idea is that the <code>core library</code> and the <code>executable</code> are on seperate git repositories, so the library is not a sub git module of the executable. </p>
  
  <p>Preferably I would be able to use ExternalProject_Add to add the <code>core library</code> to the <code>executable</code> but when I do this, the <code>executable</code> complains that it does not know anything about <code>libtorrent</code> which again the core library uses. Adding the headers of <code>libtorrent</code> to the executable wasn't enough, I would also need to link the <code>executable</code> to <code>libtorrent</code>. But why would I compile the <code>core library</code> then anyway, since I just have to add all dependencies of the <code>core library</code> to the <code>executable</code> again.</p>
  
  <p>If someone can point me in the right direction of how to setup a project that uses a core library that has other dependencies and an executable that uses the core library.</p>