Thursday, October 13, 2011

Cmake and protobuf PROTOBUF_GENERATE_CPP

Google Protocol Buffers works well with cmake but the catch is that PROTOBUF_GENERATE_CPP will not call upon the compiler to generate the files unless
  • There is some target that includes ${PROTO_SRCS} ${PROTO_HDRS} in it's file list (perhaps also the libraries for linking).
  • the target is in the same CMakeLists.txt file as the Find(Protobuf) directive. If target is in some sub-directory then the protoc compiler will not be invoked.
Also be aware: If you get a "Conversion to Dalvik format failed with error 1" error message, that probably means you are using a .jar file that was built in another machine/environment. Make sure you install maven and build the jar file in the same machine eclipse is running, just in case.

No comments:

Post a Comment