CMake Error at cmake/OpenCVUtils.cmake:1047 (message):
  Failed to download .  Status=
Call Stack (most recent call first):
  ../opencv_contrib/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:32 (ocv_download)
  ../opencv_contrib/modules/dnn/CMakeLists.txt:5 (include)



解决:到/opencv_contrib/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake中,并打开编辑,
FILENAMEPACKAGE替代

uses FILENAME as the first parameter, but should be using PACKAGE instead.

同样适用于其他的.cmake error

参考:
https://stackoverflow.com/questions/43081022/ubuntu-opencv-not-compiling


I think I've found the issue, though. I opened an issue in the opencv_contrib github. There is a call to ocv_download in the dnn and xfeatures2d cmake files that uses FILENAME as the first parameter, but should be using PACKAGE instead. When I changed the parameters to PACKAGE, CMake successfully configured opencv with the opencv_contrib modules.