title: How to build libraries depend on each other in CMakeList
body: <p>In the root directory of a project, there are two libraries folder, one is lib1 and the other is lib2.</p>
  
  <p>In lib1 folder, there are files like:</p>
  
  <pre><code>lib1Config.cmake.in + lib1ConfigVersion.cmake.in + CMakeList.txt
  </code></pre>
  
  <p>In lib2 folder, there are files like:</p>
  
  <pre><code>lib2Config.cmake.in + lib2ConfigVersion.cmake.in + CMakeList.txt
  </code></pre>
  
  <p>AND in lib2, the CMakeList.txt contains a FIND_PACKAGE(lib1 REQUIRED). when I try to run the cmake in the root directory, which just simply call add_subdirectory(lib1) and add_subdirectory(lib2), the CMakeList.txt in lib2 complains that it can not find lib1Config.cmake. Then, my question is: how can i make proper adjustments to make it work.</p>
  
  <p>FYI: here, lib1 is actually <a href="https://github.com/mccdo/osgworks/tree/master" rel="nofollow">osgworks</a> and lib2 is <a href="https://github.com/mccdo/osgbullet/tree/master" rel="nofollow">osgbullet</a>. I am trying to include them in my project's lib folder. Is it possible to do that ?</p>