Because Python packages paddle.v2.* import py_paddle, the document generation must be after we build and install Paddle (including the py_paddle Python package). This requires us to run cmake twice: 1. build and install Paddle without documentation, and then 2. build the Python API documentation from comments in Python code.
This is awkward. Also, it prevents from a complete solution of "build in Docker". We need to remove the dependency to SWIG and py_paddle soon.