(cmake 3.5, but tested from repo and had same issue, generating UNIX
Makefiles, protobuf 3)

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.

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

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.

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?


Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 

Follow this link to subscribe/unsubscribe:

Reply via email to