cocos2d-x 4.x Xcode setup

From cocos2d-x 4.0, iOS and macOS projects are not provided pre-generated. Thus, we have to generate the project files for Xcode manually using cmake. (Install cmake if necessary with homebrew)

To generate the Xcode project for iOS,

$ mkdir ios-build && cd ios-build
$ cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos

To generate the project for macOS,

$ mkdir mac-build && cd mac-build
$ cmake .. -GXcode

Not to track the build directory, add followings in .gitignore file:

ios-build/
mac-build/

Reference: https://docs.cocos2d-x.org/cocos2d-x/v4/en/installation/CMake-Guide.html