Do you possibly have any code you could make available for this?

On Wednesday, June 20, 2012 1:15:33 PM UTC-4, Justin Muncaster wrote:
> Okay, so I got this build tree working. I had to:
> (1) Modify FindProtobuf.cmake (the build rule) so that I can specify the 
> proto_path
> (2) Modify each .proto import to specify the file to import using the full 
> path from the root, even if the files are parallel to the .proto source.
> (3) Add CMAKE_SOURCE_DIR (the source tree root) to the proto_path
> (4) Add CMAKE_BINARY_DIR (the build root) to the gcc_path.
> (5) Do a clean build. I had old generated .pb.h files in the source tree, 
> and they were being included rather then the newly generated files that 
> lives in the build-tree.
> Thanks for your help.
> Justin
> On Wednesday, June 20, 2012 6:24:23 AM UTC-7, Evan Jones wrote:
>> On Jun 19, 2012, at 13:53 , Justin Muncaster wrote: 
>> > 1>Running C++ protocol buffer compiler on common/bar/bar.proto 
>> > 1>common/foo/foo.proto: File not found. 
>> > 1>bar.proto: Import "common/foo/foo.proto" was not found or had errors. 
>> > 
>> > I can fix the error by hacking FindProtobuf.cmake and passing in 
>> additional include directories, but I run into problems down the line, 
>> which leads me to think there must be a better way. Every example I see has 
>> all proto files in one folder and does not have cross-library protobuf 
>> message dependencies. 
>> This should work, and with the project you attached it does work (well, 
>> once I fixed a bad field number): 
>> Yamnuska:project ej$ protoc --cpp_out=build common/bar/bar.proto 
>> Yamnuska:project ej$ 
>> I don't know how CMake or this PROTOBUF_GENERATE_CPP rule works, but 
>> maybe you need to pass the appropriate --proto_path argument so it looks 
>> for the included .proto in the right place? 
>> Good luck, 
>> Evan 
>> -- 

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to