ported cmake configuration and code to Mac OS X 10.8