I don't know what to do when building

I read the following statement in the official opencv documentation

Downloaded dependencies
Configuration script can try to download additional libraries and files from the internet, if it fails to do it corresponding features will be turned off. In some cases configuration error can occur. By default all files are first downloaded to the /.cache directory and then unpacked or copied to the build directory. It is possible to change download cache location by setting environment variable or configuration option:

After reading this I thought that for opencv build I only need to put cmake, git and build-essential.

However, in order to enable the gstreamer feature and build with opencv on the Internet, there are additional steps to install dependencies.
For example, as follows…

Which procedure should I trust?