How to get current configuration (Release/Debug) in CMake for Visual Studio
<p>I am on Visual Studio 2013, CMake 3.5.1, Windows 10. I am trying to copy some files via CMake like below:</p>

<pre><code>file(COPY ${IMAGES} DESTINATION ${CMAKE_BINARY_DIR}/bin/Release)
</code></pre>

<p>Is it possible to replace "Release" with a variable that represents the configuration like:</p>

<pre><code>file(COPY ${IMAGES} DESTINATION ${CMAKE_BINARY_DIR}/bin/${Variable})
</code></pre>

<p>I attempted </p>

<pre><code>file(COPY ${IMAGES} DESTINATION ${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE})
</code></pre>

<p>but CMAKE_BUILD_TYPE is an empty string when I use message to print it out, I also attempted </p>

<pre><code>file(COPY ${IMAGES} DESTINATION ${CMAKE_BINARY_DIR}/bin/$&lt;CONFIGURATION&gt;)
</code></pre>

<p>but for some reason file command cannot decipher <code>$&lt;CONFIGURATION&gt;</code> whereas command like </p>

<pre><code>add_custom_target(run COMMAND ${CMAKE_BINARY_DIR}/bin/$&lt;CONFIGURATION&gt;/Test.exe)
</code></pre>

<p>can. What is the right way to extract whether visual studio is currently built in Release or Debug in CMake?</p>