Build improvements

This fixes non-Xcode builds on OSX, a Clang warning, and cleans up the CMake files a bit. See commit comments for details (is this a bad way to do it...?)
The `add_definitions` method does work, but it's not recommended, and kept mainly for backwards compatibility. It's also inconsistent with the rest of the code, which uses `CMAKE_<lang>_FLAGS`.

Quoting the [CMake documentation](http://www.cmake.org/cmake/help/v3.0/command/add_definitions.html):
> This command can be used to add any flags, but it is intended to add preprocessor definitions.