title: cmake create a shared object
body: <p>I have three files:</p>
  
  <p>lib.c lib.h => They should be built as a .so file <br />
  client.c    => This should be built as an executable. <br /> 
  Inside the client.c I include the lib.h file so as to get the declarations of the functions defined under lib.c</p>
  
  <p>Can someone tell me the exact CMakeLists file that I should be using so that the source area is uncluttered with Cmake's temporary files and the binaries and the libraries (.dlls in case of windows I believe) generated in separate build and binary directories ?</p>