[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] CMake macros & definitions for GR 3.8
From: |
CEL |
Subject: |
Re: [Discuss-gnuradio] CMake macros & definitions for GR 3.8 |
Date: |
Tue, 20 Aug 2019 13:00:22 +0000 |
Hi Emmanuel,
so, with 3.8 we're switching to the more modular modern CMake.
I assume you've created an out-of-tree module using `gr_modtool newmod`
(if you haven't, try it; you get a useful stub!).
Essentially:
find_package(Gnuradio "3.8" REQUIRED COMPONENTS blocks analog)
will give you a GNU Radio configuration that has all the components
blocks, and analog.
Then, in the directory where your C++ sources lie, you tell CMake to
link against components (let's assume our OOT is called gr-fobb):
add_library(gnuradio-fobb SHARED ${fobb_sources}) # fobb_sources: list of .cc
files
target_link_libraries(gnuradio-fobb gnuradio::gnuradio-runtime
gnuradio::gnuradio-analog gnuradio::gnuradio-blocks)
If you feel more comfortable with 3.7, maybe this [1] page helps you.
Best regards,
Marcus
[1]
https://wiki.gnuradio.org/index.php/GNU_Radio_3.8_OOT_Module_Porting_Guide
On Mon, 2019-08-19 at 17:25 +0200, Emmanuel Blot wrote:
> Hi,
>
> I’m unable to find how to obtain, from the various GR 3.8 CMake
> macros, the installation paths to link an external application with the
> GR libraries.
> Most FAQ/existing projects refer to 3.7 series, and it seems there have
> been some changes which makes difficult to understand what is required
> today.
>
> Is there some doc/guide/readme/anything to help with this topic?
>
> I’m looking to retrieve the name & path of the GR libraries, the path
> to the GR installation dir and include directories.
> Ideally, I guess that the proper sequence would look something like
>
> * define GR_REQUIRED_COMPONENTS
> * find GR package: which ones?
> * include some GR CMake modules: which ones?
> * invoke a couple of macros: which ones?
>
> so that ${GR_something} defines the list of imported library to link
> against a target, i.e. with TARGET_LINK_LIBRARIES and the like can use a
> valid list of libraries.
>
> I guess it is possible to recode everything from scratch, but it seems a
> bit overkill :-)
>
> There are many projects that refer to GNURADIO_ALL_LIBRARIES or to
> GNURADIO_RUNTIME_LIBRARY_DIRS, but I’m unable to find what to do w/ GR
> 3.8 so that these variables get defined.
>
> Thanks,
> Emmanuel.
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
smime.p7s
Description: S/MIME cryptographic signature