CogRob/catkin_grpc

protoc fails if SRC_BASE is specified and proto files are given as absolute paths

Closed this issue · 0 comments

Hi, I'm trying to compile protobuf files specified as absolute paths with custom SRC_BASE specified, but it fails on running protoc.:

File does not reside within any path specified using --proto_path (or -I).  You must specify a --proto_path which encompasses this file.  Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think).

After investigating cmake rules, I found in the following part ( https://github.com/CogRob/catkin_grpc/blob/master/grpc/cmake/generate_proto.cmake#L177-L192 ),
path to .proto file is given to protoc executable as absolute path ${ABS_FILE_PATH} while the first include directory -I${SRC_RELATIVE_BASE_DIR} is given as relative path which occurs an error on running protoc.