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...?)
Any reason you switch to setting the `CMAKE_<lang>_FLAGS` instead of using `add_definitions`?