add darwin platform support
fix cmake
Merge pull request #8 from oranzhang/master

add darwin platform support