My team is attempting to package a collection of .proto
files into a shared library for use in multiple other repositories. Currently, this is done by compiling them into a C++ static library that the other repositories link with. However, we also need the .proto
files themselves to be shared with the dependent programs, since there are more protobuf files in those that require those base definitions.
I have tried to use install(FILES)
within CMake to expose the proto files, however I was unable to find a Conan setting to pass that folder’s path to the dependent CMake scripts. I attempted to use self.cpp_info.resdirs
, but that only gets exposed to CMake as mypackage_RES_DIRS_RELEASE
, with the build type suffix, and attempting to use generator expressions to filter on those didn’t seem to pass a valid path to protobuf_generate
.
I also tried using the include directories argument, but ran into similar but strange issues – the include paths were being passed to protoc as /root/.conan2/p/...//root/.conan2/p/...
, with no separator, which resulted in some invalid paths. This is being built inside a development container, hence the /root path. I don’t have the exact code with me right now, so I can’t see how far down it got, but I think it was all the way to a build folder.
Is there a known way to share these proto files with dependent builds? Is this even the “correct” way of sharing definitions?
2