discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] cmake problem


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] cmake problem
Date: Sat, 24 May 2014 22:08:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

Hi Mostafa,

first things first: If you're trying to use things from the GNU Radio main tree, refer to [1].

If you want to use external libraries, you will need to modify the CMakeLists.txt in your module directory and in  your lib/ directory.
In the main CMakeLists.txt you will find a paragraph starting with "# Find *** build dependencies"; after that you'll see lines like "find_package(some_library)"; some_library matches a script Findsome_library.cmake in the cmake/Modules subdirectory.
You might need to write your own, but most probably someone else has already done that for you, and you can use his code.
This script will set some variables pointing to the header files and to the linkable library; you will have to add these to the include_directories(..) variable and link_directories(..), respectively.
In the lib/CMakeLists.txt, you will need to extend the variables of the same names, and set the target_link_libraries accordingly (for both the main library and the test).

To see a modern implementation of this with some interesting external dependencies, maybe take a look at
http://git.osmocom.org/gr-fosphor/tree/ (CMakeLists.txt, lib/CMakeLists.txt, cmake/Modules/) .

Greetings,
Marcus

[1] http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModulesConfig

On 24.05.2014 17:25, Mostafa Alizadeh wrote:
Hi,

I want to ask these questions about how to write cmake lists when we making
gr-xxx projects (modules) with gr_modtool:

1- How could I add dependencies of my project! For example I'm using a c++
library in one of my gr block, so how could I tell cmake to check the
dependency? I read GNURadio tutorial :
http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModulesConfig
But it's confusing! (I'm using GNURadio 3.7.3)

2- How could I merge all of my gr-xxx modules to a single project with with
which I could cmake all the modules and *making* them? This is like
GNURadio source file which one has to cmake, make, install all the gr
modules together.

I know I must use:
*add_subdirectory(gr-xxx) *
in cmake lists but what are the other changes?

best,
mostafa



_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


reply via email to

[Prev in Thread] Current Thread [Next in Thread]