Fixes cmakefile for mac
Merge pull request #7997 from ricardoquesada/fixes_cmakefile_for_mac

Fixes cmakefile for mac