Skip to content

DNN module build failed with PROTOBUF_UPDATE_FILES  #2408

@smartnet-club

Description

@smartnet-club
  • OpenCV => 4.2.0
  • Operating System / Platform => Linux acer 4.15.0-74-generic fixed android warnings #83~16.04.1-Ubuntu SMP Wed Dec 18 04:56:23 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  • Compiler => gcc (Ubuntu 6.5.0-2ubuntu1~16.04) 6.5.0 20181026
Detailed description

error: opencv-caffe.pb.h not found

Steps to reproduce

build with:
-DWITH_PROTOBUF:BOOL=ON
-DBUILD_PROTOBUF:BOOL=FALSE
-DPROTOBUF_UPDATE_FILES:BOOL=ON
-DOPENCV_DNN_EXTERNAL_PROTOBUF:BOOL=ON

to fix
in dnn/CMakeLists.txt

file(GLOB proto_files "${CMAKE_CURRENT_LIST_DIR}/src/tensorflow/*.proto" "${CMAKE_CURRENT_LIST_DIR}/src/caffe/opencv-caffe.proto" "${CMAKE_CURRENT_LIST_DIR}/src/onnx/opencv-onnx.proto")
set(PROTOBUF_GENERATE_CPP_APPEND_PATH ON) # required for tensorflow
protobuf_generate_cpp(fw_srcs fw_hdrs ${proto_files})
set(fw_inc "${CMAKE_CURRENT_BINARY_DIR}/src/caffe" "${CMAKE_CURRENT_BINARY_DIR}/src/tensorflow" "${CMAKE_CURRENT_BINARY_DIR}/src/onnx")

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions