opencv-python
opencv-python copied to clipboard
fix: add CMake as a build requirement only if required
The PyPI distribution of CMake shall not be listed as an unconditional build requirement. It shall only be added as a build requirement if not installed or too low a version.
This helps building from sources on platforms where no wheels are available for CMake but the system already provides a recent enough CMake version. Adress the comment in https://github.com/opencv/opencv-python/issues/793#issuecomment-1436843424.
In case of error checking the version, the backend falls back to using the PyPI distribution of CMake.