Fix build with cmake, add cmake support to travis

You should take a look at numerous warnings.