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: Sun, 25 May 2014 09:05:52 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

Hi Mostafa,

you've forgot to add the mailing list in your reply question; please
always remember to do that :)

> My library is a package. I think I can find it with package config tool, so
> I don't need *Findsome_library.cmake.* Am I right?

Ok, this is getting too far away from GNU Radio. I'm referring you to
http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries
especially the introduction and the pkg-config related stuff on that page.

Hope that helps,
Greetings,
Marcus

On 25.05.2014 08:51, Mostafa Alizadeh wrote:
> Thank you Marcus,
>
> My library is a package. I think I can find it with package config tool, so
> I don't need *Findsome_library.cmake.* Am I right?
> I didn't understand how could I obtain the the *variables *that pointing to
> the header files and to the linkable library as I need to add them in the
> main cmake:
>
> *include_directories(${library_include_dir})*
> *link_directories(${library_dir})*
>
>  The same question is for lib/ directory cmake. What is the name_of_library
> in :
>
> *target_link_libraries(${name_of_library})*
>
> best,
>
> Mostafa
>
>
>
>
> On Sun, May 25, 2014 at 12:38 AM, Marcus Müller <address@hidden>wrote:
>
>>  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 
>> address@hidden://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>>
>>
>> _______________________________________________
>> 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]