title: How do I tell cmake to output to a target architecture folder?
body: <p>Basically, I want CMake to generate a folder depending on the target architecture that I am building for in both the library folder and the bin folder. I.e. My project structure looks like:</p>
  
  <pre>src/
      a.cpp
      b.cpp
  lib/
  bin/
  </pre>
  
  <p>And I want the result of CMake to be as follows:</p>
  
  <pre>src/
      a.cpp
      b.cpp
  lib/
      i686-w64-mingw32/
          project.a
  bin/
      i686-w64-mingw32/
          project.exe
  </pre>
  
  <p>Where <code>gcc -dumpmachine</code> produced <code>i686-w64-mingw32</code> (but ideally this would work for all compilation flows including visual studio and xcode).</p>