initial version of cmake

This still has some bugs, just for backup.