title: CMake, Exe cant find DLL
body: <p>so im trying to setup a project, on windows, with cmake</p>
  
  <p>this is what my project structure looks like:</p>
  
  <ul>
  <li>GameEngine</li>
  <ul><li>.git</li><li>build</li><li>include</li><li>source</li><li>testing</li><li>CMakeLists.txt</li></ul>
  </ul>
  
  <p>the idea is that the "source" directory contain all the .cpp files for the GameEngine library, the "include" directory contain all the header files and the "testing" directory is for testing the library. So it should depend on the GameEngine.dll and GameEngine.lib (on windows).</p>
  
  <p>my <b>top level</b> CMakesLists.txt contain:</p>
  
  <pre><code>    cmake_minimum_required(VERSION 2.7)
      PROJECT( GameEngine )
  
      include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include )
  
      ADD_SUBDIRECTORY( source )
      add_subdirectory( testing )
  </code></pre>
  
  <p><br/>
  the CMakeLists.txt in the <b>"source"</b> directory contain:</p>
  
  <pre><code>    project(GameEngineLib)
  
      file(GLOB src "*.cpp" "../include/*.h")
  
      add_library(${PROJECT_NAME} SHARED ${src})
  </code></pre>
  
  <p><br/></p>
  
  <p>and the CMakeLists.txt in the <b>"testing"</b> directory contain:</p>
  
  <pre><code>    project(Testing)
  
      file(GLOB src "*.h" "*.cpp")
  
      ADD_EXECUTABLE( ${PROJECT_NAME} ${src})
      target_link_libraries(${PROJECT_NAME} GameEngineLib)
  </code></pre>
  
  <p><br/></p>
  
  <p>This all works fine on linux.<br/>
  when i build it, i get two folders (+ some others), "testing" and "source" and a Makefile that outputs an executable and a .so file.<br/>
  and the executable already know where to find the .so file, so i can just run without any errors.</p>
  
  <p><br/>
  The problem comes when i build on windows with visual studio. <br/>
  Everything works except that the Testing executable, that i get after building the "ALL_BUILD" project, gives me an error saying that it can't find GameEngineLib.dll.</p>
  
  <p><br/>
  I tried searching around on google on how to fix the problem, but most of the solutions i found just said that you had to manually change your settings in visual studio, to look for the dll, where its located.</p>
  
  <p><br/>
  but if i was working in a team with multiple developers, i wouldn't really want to have every developer that uses visual studio to have to go in and change settings in the project themselves.</p>
  
  <p><br/>
  isn't there a way to tell cmake to automatically copy the GameEngineLib.dll to the Tester.exe's folder?</p>