add APPLE support for cmake

Signed-off-by: xiehuc <xiehuc@gmail.com>