This is the script I use to compile my protocol buffer files.  The last few
lines are the key ones - I use "find" to locate all the protocol buffer
files relative to the root directory $SRC_ROOT and then pass all of those
files to the protocol compiler, and it stores the results elsewhere, under
$PROTO_ROOT.

I have quite a lot of proto files, so this is very convenient so that my
generated _pb.cc and .pb.h files don't litter my source directories (and so
I can blow away all the generated files without fear...)

Sorry, I won't be able to help with more details on how I do it, have fun!


PACKAGE=protobuf
CONFIG=debug

source "$ROOT/rec/scripts/variables.sh"

SRC_ROOT="$ROOT/rec/src"
PROTO_ROOT="$ROOT/rec/genfiles/proto"

mkdir -p "$PROTO_ROOT"
echo "Deleting `find "$PROTO_ROOT" -name \*.pb.\* | wc -l` compiled files."
find "$PROTO_ROOT" -name \*.pb.\* | xargs rm

find "$SRC_ROOT" -name \*.proto |\
 xargs "$INSTALL_DIR/bin/protoc"\
   --proto_path "$SRC_ROOT"\
   --proto_path "$ROOT/build/$CONFIG/protobuf/include"\
   --cpp_out="$PROTO_ROOT"





On Thu, Jan 26, 2012 at 1:58 PM, joel <[email protected]>wrote:

> Yeah you are right i will check what i can do with this and I'll post back
> if I
> have other question
>
> Do you have an example to see how using  --proto_path
>
> Thanks
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>


-- 
     /t

http://radio.swirly.com - art music radio 24/7 366/1000

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to