[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] GNURadio CMake module/files for Google Protocol B
From: |
Andy Walls |
Subject: |
Re: [Discuss-gnuradio] GNURadio CMake module/files for Google Protocol Buffers file generation? |
Date: |
Sun, 26 Jul 2015 13:47:56 -0400 |
On Sun, 2015-07-26 at 12:00 -0400, address@hidden
wrote:
> Message: 8
> Date: Sun, 26 Jul 2015 15:13:07 +0200
> From: Marcus M?ller <address@hidden>
> To: address@hidden
> Subject: Re: [Discuss-gnuradio] GNURadio CMake module/files for Google
> Protocol Buffers file generation?
> 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
Thanks, Marcus!
That ia the sort of running start I was looking for.
R,
Andy
> 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
> >