added cmakelists and fixed compilation errors