title: How to find a library with cmake?
body: <p>To link an executable with a library that resides in a standard location, one can do the following in a CmakeLists.txt file:</p>
  
  <pre><code>create_executable(generate_mesh generate_mesh.cpp)
  target_link_libraries(generate_mesh OpenMeshCore)
  </code></pre>
  
  <p>This would work if the library, that is being linked against, was placed in </p>
  
  <pre><code>/usr/local/lib/libOpenMeshCore.dylib
  </code></pre>
  
  <p>However, in this case the library resides under</p>
  
  <pre><code>/usr/local/lib/OpenMesh/libOpenMeshCore.dylib
  </code></pre>
  
  <p>How can I specify that target_link_libraries should really link against a library placed in a sibdirectory? I wonder there is some useful option to target_link_libraries that would specify that the library is in a subdirectory in a standandard location, e.g.</p>
  
  <pre><code>target_link_libraries(generate_mesh OpenMesh/OpenMeshCore)
  </code></pre>
  
  <p>If that is not possible, is there a way to use find_library to search <code>/usr/local/lib</code> recursively, including its sub-directories, for the given library file? </p>