title: How to link a shared library with CMake with relative path
body: <p>I want to link a third-party <code>libLibrary.so</code> and distribute it with my program. If user unzips my archive, he will get this folder structure:</p>
  
  <pre><code>game
    libLibrary.so
    game_executable
  </code></pre>
  
  <p><code>game_executable</code> depends on <code>./libLibrary.so</code>.</p>
  
  <p>My project structure:</p>
  
  <pre><code>game
    bin
      libLibrary.so
    lib
      Library.h
    src
      game_executable.cpp
    CMakeLists.txt
  </code></pre>
  
  <p>My <code>CMakeLists.txt</code>:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.7)
  project(game)
  
  set(CMAKE_CXX_STANDARD 14)
  
  set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin)
  set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
  set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
  
  set(SOURCE_FILES src/game_executable.cpp)
  include_directories(${CMAKE_SOURCE_DIR}/lib)
  add_executable(game ${SOURCE_FILES})
  target_link_libraries(${PROJECT_NAME} ${CMAKE_BINARY_DIR}/libLibrary.so)
  </code></pre>
  
  <p>However, what I get is my <code>game_executable</code> depends on the <code>.../game/bin/libLibrary.so</code>, not on the <code>./libLibrary.so</code> that is in the folder with <code>game_executable</code>, making this totally unportable!</p>
  
  <p>How can I make linking path relative instead of absolute?</p>