[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] GNURadio CMake module/files for Google Protocol B
From: |
Marcus Müller |
Subject: |
Re: [Discuss-gnuradio] GNURadio CMake module/files for Google Protocol Buffers file generation? |
Date: |
Sun, 26 Jul 2015 15:13:07 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
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
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio