CMake fixes for Mac build