gmt 5.1.0

GMT build system has now moved to cmake, so I had to change quite a lot of stuff.

This is my first homebrew formula, so please go ahead and fix everything which is incomplete/inconsistent.