Better OS X support in CmakeLists.txt