title: How to include a library using CMAKE in a cross-platform way
body: <p>I am trying to use the <a href="https://github.com/assimp/assimp/blob/master/tools/assimp_view/CMakeLists.txt" rel="nofollow noreferrer">assimp</a> library in a cross platform C++ project.  I include the repo as a git submodule, so, effectively, if someone downloads my project they will also download the ASSIMP project.</p>
  
  <p>After I go through the assimp build / CMAKE instructions and (on Linux) type <code>make install</code> and from then on in my project I can use:</p>
  
  <p><code>target_link_libraries(${PROJECT_NAME} assimp)</code></p>
  
  <p>However, there is no <code>make install</code> on Windows.</p>
  
  <p>The only other way I have been able to include the library on Linux is to put (in my <code>CmakeLists.txt</code> file): </p>
  
  <p><code>target_link_libraries(${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/build/assimp/code/libassimp.so)</code></p>
  
  <p>This is not cross platform as it hardcodes the name and location of the <code>.so</code> file which will not work on Windows.</p>
  
  <p>How can I expose the library so that I can do something like <code>target_link_libraries(${PROJECT_NAME} assimp)</code> on all platforms?</p>
  
  <p>My directory tree looks like:</p>
  
  <pre><code>- src
  - include
      - assimp
  - bin
  </code></pre>
  
  <p>Where the <code>assimp</code> directory in the <code>include</code> directory is the git submodule</p>