title: CMake find_package dependency on subproject
body: <p>I have the following directory layout:</p>
  
  <pre><code>main_folder
   + static_lib1
   + executable
  </code></pre>
  
  <ul>
  <li>Both 'static_lib1' and 'executable' have a full CMakeLists so that they can be
  built independently.</li>
  <li>The 'executable' depends on 'static_lib1'. It uses <code>find_package()</code> to locate 'static_lib1'.</li>
  <li>The main_folder contains a CMakeLists that includes both 'static_lib1' and 'executable' via <code>add_subdirectory</code> for conveniently building the whole project in one go.</li>
  </ul>
  
  <p>Everything works fine if I manually build 'static_lib1' and then 'executable'. But when running the CMakeLists from the main folder, I get an error because <code>find_package</code> is unable to find the library files from 'static_lib1' which have not yet been built.</p>
  
  <p>How can I resolve this while keeping the CMakeLists files separate (i.e. without including the static_lib's CMakeLists from the executable's CMakeLists)?</p>