Unable to get automake to build .proto files into .pb.cc files with google protocol buffers -


i've been trying automake automagically determine how build .pb.cc , .pb.hh files google protocol buffers .proto description, have had no luck.

i've tried using this post on so, still doesn't work.

here's excerpt makefile.am:

protoc=@ac_protoc_cmd@ %.pb.h %.pb.cc: %.proto     $(protoc) --proto_dir=$(srcdir)/proto --cpp_out=$(srcdir) $(srcdir)/proto/$<  libtass_a_sources = \     $(srcdir)/tass.pb.cc  nobase_include_headers = \     $(srcdir)/tass.pb.h 

upon attempting run make, get:

> making in src  > make[1]: entering directory `/project/tass/src' > make[1]: *** no rule make target `tass.pb.cc', needed `tass.pb.o'. stop.   > make[1]: leaving directory `/project/tass/src' > make: *** [all-recursive] error 1 

ac_proto_cmd filled in path protoc binary configure.ac when check gpb dependency. i've verified it's of form "/opt/common/protobuf/-version-/bin/protoc" keep gpb library.

i'm trying keep .proto files in src/proto, , have protoc spit out compiled cc , h files src. however, moving .proto files src/ doesn't work, don't think that's problem. far can tell, make isn't attempting invoke protoc, i'm not sure rule being interpreted correctly @ make.

thanks in advance on this.

the problem here build dependencies, because automake finds dependencies side effect of compilation (see http://www.gnu.org/software/automake/manual/html_node/sources.html explaination of workaround) have add line:

built_sources = $(srcdir)/tass.pb.cc 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -