cmake: add mac os x support in root script