Add cmake project, and fix code compilation. Linking still broken.