Hi Andy,
without knowing for sure, I'd assume there'd be a bit of reinventing
wheels that will be unavoidable.
However, CMake does distribute a FindProtobuf.cmake [1], which
conveniently contains a command
protobuf_generate_cpp (<SRCS> <HDRS> [<ARGN>...])
Now, I'd say you'd just do the same as for the source files in
lib/CMakeLists.txt, i.e. add a list variable that contains your proto
files, like
list(APPEND gr_andys_module_proto_defs
bufdef1.proto
bufdef2.proto
)
and then
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${gr_andys_module_proto_defs})
and where you define the sources of your module, have that include
${PROTO_SRCS}.
You might run into some include path strangenesses, and I've found that
adding ${CMAKE_BINARY_DIR}/lib (or similar) to the include_directories()
directive might help
Cheers,
Marcus
[1] http://www.cmake.org/cmake/help/git-master/module/FindProtobuf.html
On 26.07.2015 14:57, Andy Walls wrote:
Hi:
Can anyone point me to a CMake module or files that call the Google
Protocol Buffers compiler to generate *.pb.h and *.pb.cc before building
object files?
Something already integrated with the GNURadio build system would be
ideal.
I don't want to reinvent the wheel. Thanks.
Regards,
Andy
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio