Add cmake files for building on various platforms.

Currently, I just tested on Ubuntu 12.04 amd64.