title: CMake splits the generated files between build and src directory
body: <p>My problem is when I run <code>$ cmake /path/to/source/</code> the resulting files and directories are split between the directory I'm calling from and /path/to/source/include. </p>
  
  <p>Here is my CMake project:</p>
  
  <p>File structure:</p>
  
  <pre><code>root:
  |-CMakeLists.txt
  |-src
  |  |-CMakeLists.txt
  |  |-"source files"
  |-include # This is where part of the generated files are ending up.
  |  |-CMakeLists.txt
  |  |-"include files"
  </code></pre>
  
  <p>Here are my CMakeLists.txt's:</p>
  
  <p>root/CMakeLists.txt:</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8)
  
  project(DUCKSIM)
  
  # Add the root directory for the CMakeLists.txt being called. This is necessary for
  # out-of-tree builds. 
  include_directories(${CMAKE_CURRENT_SOURCE_DIR})
  
  # Add the directories containing source and header files.
  add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/include)
  
  set (CMAKE_RUNTIME_OUTPUT_DIRECTORY $(pwd)) # This is an attempt to fix my problem
  </code></pre>
  
  <p>src/CMakeLists.txt:</p>
  
  <pre><code># set(CMAKE_INCLUDE_CURRENT_DIR ON)
  
  # Set DUCKSIM_SOURCES as all .cpp files
  file(GLOB DUCKSIM_SOURCES *.cpp)
  
  # Set the name of the executable as "ducksim" and link it with main.cpp
  # and every thing in the DUCKSIM_SOURCES variable.
  add_executable(ducksim main.cpp ${DUCKSIM_SOURCES})
  </code></pre>
  
  <p>include/CMakeLists.txt:</p>
  
  <pre><code># set(CMAKE_INCLUDE_CURRENT_DIR ON)
  
  # Set DUCKSIM_SOURCES as all .h files
  file(GLOB DUCKSIM_SOURCES *.h)
  </code></pre>