title: cmake: add "d" suffix for debug build of static library
body: <p>I would like to implement a naming scheme for libraries similar to the one mentioned here: <a href="https://stackoverflow.com/questions/739023/library-name-for-x32-vs-x64">Library name for x32 vs x64</a></p>
  
  <p>The CMakeLists.txt file is setup to create a static library</p>
  
  <pre><code>add_library(test test.h test.cpp)
  </code></pre>
  
  <p>After creating a visual studio solution from the cmake lists the project is set up in such a way that the debug library test.lib is written to <code>/x64/Debug/test.lib</code> and the release version is written to <code>/x64/Release/test.lib</code>. I would prefer to write them both to <code>/lib/</code> but append a "d" to the debug version. The idea is to get</p>
  
  <pre><code>/lib/test.lib
  /lib/testd.lib
  </code></pre>
  
  <p>and if possible have an additional suffix for 64 bit builds to get</p>
  
  <pre><code>/lib/test.lib
  /lib/test64.lib
  /lib/testd.lib
  /lib/test64d.lib
  </code></pre>
  
  <p>Is there a straightforward way to do this?</p>
  
  <hr>
  
  <p>Edit:
  this can be used later nicely in the project using the libs like this:
  <a href="https://stackoverflow.com/questions/2209929/linking-different-libraries-for-debug-and-release-builds-in-cmake-on-windows">Linking different libraries for Debug and Release builds in Cmake on windows?</a></p>
  
  <hr>
  
  <p>Edit: I had problems removing the Debug and Release folders from the output, which can be fixed by this answer: <a href="https://stackoverflow.com/questions/8848268/how-to-not-add-release-or-debug-to-output-path">How to not add Release or Debug to output path?</a></p>