Merge pull request #7997 from ricardoquesada/fixes_cmakefile_for_mac

Fixes cmakefile for mac
Fixes Xcode 6 warnings
Merge pull request #7998 from ricardoquesada/xcode_6_compatible

Fixes Xcode 6 warnings