CMake build-related fixes

When building through CMake on Mac OS X with clang the compiler emits a warning about unused arguments for all of the directories specified with -I which wasn't used causing the compilation to emit quite amount of warnings (making it hard to see "real" warnings.

The second patch ignores build artifacts generated by CMake.