title: Why aren't binaries placed in CMAKE_CURRENT_BINARY_DIR?
body: <p>It is my understanding that <code>CMAKE_CURRENT_BINARY_DIR</code> should point to the directory where binaries for the current CMakeLists.txt file will be placed. However, this doesn't seem to be the case.</p>
  
  <p>Consider this file structure:</p>
  
  <pre><code>CMakeTest
  +- CMakeLists.txt
  +- main.cpp
  </code></pre>
  
  <p><strong>CMakeLists.txt</strong></p>
  
  <pre><code>cmake_minimum_required(VERSION 3.2)
  add_executable(CMakeTest main.cpp)
  message(STATUS "CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}")
  </code></pre>
  
  <p><strong>main.cpp</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int main() {
      std::cout &lt;&lt; "Hello, World!";
      return 0;
  }
  </code></pre>
  
  <p>On the (Windows) command line, I run the following commands:</p>
  
  <pre><code>md build
  cd build
  cmake .. -G "Visual Studio 14 2015"
  cmake --build .
  </code></pre>
  
  <p>The first <code>cmake</code> command prints (among other things) the line</p>
  
  <blockquote>
    <p>CMAKE_CURRENT_BINARY_DIR = X:/dev/projects/CMakeTest/build</p>
  </blockquote>
  
  <p>So I'd expect the resulting binary file CMakeTest.exe to end up there. Really, however, it is placed in X:/dev/projects/CMakeTest/build/Debug.</p>
  
  <p><em>Why isn't the binary file placed into <code>CMAKE_CURRENT_BINARY_DIR</code>, but in a sub-directory? And is there any CMake variable that tells me what that subdirectory is?</em></p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I'm not trying to <em>change</em> the directory where binaries are placed. I'm trying to <em>determine</em> it. The reason is this:</p>
  
  <p>During build, a number of additional resource files are created in the same directory as the executable file. (This part works.) I'd like to use the <code>install(FILES, ...)</code> command to then add these files to the resulting package. So I need to pass the actual path where the binaries are placed to <code>install(FILES, ...)</code>.</p>