<div dir="ltr">(cmake 3.5, but tested from repo and had same issue, generating UNIX Makefiles, protobuf 3)<br><br>When I have protobufs more than one folder deep (eg, folder with cmake has folder with protobufs and another folder which also has more protobufs), cmake has some trouble generating the correct make files.<br><br>Suppose in my folder 'protos' with the CMakeLists.txt that generates from protobuf, I have folders Alpha and Beta. Beta contains Ball.proto; Alpha contains Axle.proto and folder Aleph with Anchor.proto. When CMake generates the build directory for protos, it puts Ball.pb.{h,cpp} and Axle.pb.* in the top level of the protos build folder, a folder Aleph with Anchor.pb.* . However, the make instructions look for Anchor.pb.* in the top-level folder, and it fails to find Anchor.pb.cpp for Anchor.pb.o . If I go in and manually edit the failing line of the make file, make is successful.<br><br>Second, supposing within these directories there are two messages with the same name, but belonging to separate protobuf 'packages.' CMake complains that it has already generated a build rule for the given protobuf. I think this shares the same root issue of cmake respecting nested folder structures within.<br><br>I can think of various solutions to these problems on my end, but it would be ideal not to have to rearrange the file structure, nor build many subprojects linked together. Is there a way to get cmake to reproduce the existing file structure and build as one project?<div><br></div><div>Alex</div></div>