[CMake] using cmake with google's protocol buffers

Neil Girdhar mistersheik at gmail.com
Wed Sep 17 19:16:33 EDT 2008


Hi, I'm trying to add a special cmake rule to build google's protocol
buffers, and I was hoping someone could help me do it.  I've broken down the
details of the protocol compiler here, so all that's missing is a cmake
expert.

I have some ".proto" files that live in the same directories as the source.
I want to specify a rule that calls this:

protoc DIR/SOMEFILE.proto  --cpp_out=SOMEDIR

SOMEDIR should probably be DIR/CMakeFiles/DIR.dir

this will generate
SOMEDIR/SOMEFILE.pb.h
SOMEDIR/SOMEFILE.pb.cc

I want to include SOMEFILE.pb.h in my source files and I want them to be
found.
I want to compile and link SOMEFILE.pb.cc automatically

what is the easiest set of rules that I can use to extend cmake to do this?

Thanks

Neil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080917/41092258/attachment.htm>


More information about the CMake mailing list