[protobuf] Re: Nested protobuf file folders and cmake flattening the structure.

2016-11-29 Thread Alex Shaver
Also, this only seems to be a functionality provided in CMake 3.7.0, actually. I neglected to mention that I was experimenting with that branch when I was studying this problem. On Monday, November 28, 2016 at 9:47:21 AM UTC-5, Alex Shaver wrote: > > When I have several folders > top > \ - A

Re: [protobuf] Re: Nested protobuf file folders and cmake flattening the structure.

2016-11-29 Thread Alex Shaver
Solution: This doesn't seem to be either documented or intuitive, but this will solve the problem: >From the top level directory, specify your proto files relative to that directory (either listing explicitly, or file(GLOB_RECURSE proto_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.proto) if you

Re: [protobuf] Re: Nested protobuf file folders and cmake flattening the structure.

2016-11-29 Thread Alex Shaver
I'm just using the default FindProtobuf.cmake commands which have the protoc step built in to them internally. I tried mailing the cmake list for support on this, but I didn't receive a response (I'm not sure who maintains this file). That file may not have the appropriate logic to handle this

Re: [protobuf] Re: Nested protobuf file folders and cmake flattening the structure.

2016-11-28 Thread 'Feng Xiao' via Protocol Buffers
How did you run the protoc command? The generated code corresponds the import path of the .proto files. For example, if you have a directory like this: root + project + foo + bar.proto Invoking protoc in the root directory with: protoc --cpp_out=. project/foo/bar.proto will generate

[protobuf] Re: Nested protobuf file folders and cmake flattening the structure.

2016-11-28 Thread Alex Shaver
Issue with approach 3, that I don't understand: Generated header files create internal implementation functions like : void protobuf_InitDefaults_Baz_2eproto(); but source files using these functions are looking for: protobuf_InitDefaults_project_2ffoo_2fBaz_2eproto(); When I compare the resul