Updated CMake build, currently only tested on OSX