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
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

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

Reply via email to