added cmake support and fixed compilation under linux