CMake related fixes

On Mac OS X I'm getting tons of warnings from unused arguments caused by include directives not being used for the compilation for the file. This is flooding the console making it hard to see actual compile warnings.

In addition to that the cmake builds is generating build artifacts that should be ignored.