Migrate to cmake