FindProtobuf: Document PROTOBUF_GENERATE_CPP_APPEND_PATH
I was working on a protobuf cmake project with nested proto files as below. The output .cc and .h files were being put into the build folder directly (the directory structure was lost) which was causing issues. It turns out cmake has a magic variable in generate_protobuf
called PROTOBUF_GENERATE_CPP_APPEND_PATH
which, when set to Off
makes this work as I expected.
proto
├── CMakeLists.txt
└── dir
├── dir
│ └── v1
│ ├── foo.proto
│ └── utils.proto
└── dir
├── dir
│ └── v1
│ └── bar.proto
└── dir
└── v1
└── baz.proto
and CMakeLists.txt using protobuf_generate_cpp
.
It seems to have been there forever but is not documented well. I don't think I understand it well enough to be able to document it myself.
Edited by Brad King