add cmake support, fix Linux compilation