title: How to use CMake to find and link to a library using install-export and find_package?
body: <p>You have a CMake-enabled library project. You need to use it in another library or executable. How to use CMake to find and link to the library? You may have the following preferences:</p>
  
  <ul>
  <li>write the least possible amount of boiler-plate code</li>
  <li>decouple the internal details of the linked library from the consuming target</li>
  </ul>
  
  <p>Ideally, the usage of the library should look like this:</p>
  
  <pre><code>add_executable(myexe ...)
  target_link_libraries(myexe mylib::mylib)
  </code></pre>