[Top][All Lists]

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

Re: [Discuss-gnuradio] adding XML support to OOT block

From: Steven Knudsen
Subject: Re: [Discuss-gnuradio] adding XML support to OOT block
Date: Mon, 16 May 2016 22:48:42 -0600

Hi Martin,

Thanks for the pointer. For some reason I did not see your response in my in box, but only now that I checked the online list. Saying that because on my own I finally tracked the problem down, which made me curious about any responses...

For the sake of anyone who cares, the main clue was, of course, linking. Once I had read enough about cmake and then looked in my <module>/lib/CMakeLists.txt at the “target_link_libraries”, it became clear enough.

  • I added to the OOT root level <module>/CMakeLists.txt a find_package(PugiXML) and supporting check (I’m using libpugixml-dev on my system). I made sure the PugiXML_LIBRARY and PugiXML_INCLUDE_DIR were added in the right places in the CMakeLists.txt.
  • Of course, I had to add to cmake/Modules the appropriate FindPugiXML.cmake module for all that to work.
  • Then, in <module>/lib/CMakeLists.txt, I added in the target_link_libraries the reference to the libpugixml, specifically “${PugiXML_LIBRARY}. I placed it right after “gnuradio-<module>”, but I suppose it could have been placed at the end as well.

Anyway, as per usual I can hope that figuring this out the hard way (aka, right way by RTFM) I may have learned something that will stick in my head.

Time to go write this up in my HOWTO wiki…

Thanks again!

Hi Steven,

if you go to cgran.org, you'll find a bunch of OOTs that have external
dependencies. gr-nacl depends on libsodium, for example. I recommend
checking those CMake files for examples.


On 05/16/2016 08:37 AM, Steven Knudsen wrote:
> Hi,
> I would like to do something I think is not uncommon and that’s to add
> XML support to a block (e.g., to read a config file). 
> Everything compiles, but on link all the libxml2 functions generate
> “undefined references”. I believe there is a missing -lxml2, but how and
> where to add?
> Online search does not turn up much, and what there is seems to be from
> around 2008 when the build system was different.
> I did try modifying the CMakeLists.txt for my module, but it appears
> that I don’t know how to augment or override the GR support for libxml2.
> That is, I can add find_package(LibXml2) and that works as expected, but
> modifying any of the env vars doesn’t seem to help.
> Any advice would be much appreciated. I suspect there may be an example
> out there that I’ve just not found and I will be chagrined, but grateful
> to the person that kicks me that direction…
> Thanks very much,
> steven
> Steven Knudsen, Ph.D., P.Eng.
> www. techconficio.ca <http://techconficio.ca>
> www.linkedin.com/in/knudstevenknudsen
> <http://www.linkedin.com/in/knudstevenknudsen>
> /Der entscheidende Augenblick der menschlichen Entwicklung
> ist immerwährend. Darum sind die revolutionären geistigen Bewegungen,
> welche alles Frühere für nichtig erklären, im Recht, denn es ist
> noch nichts geschehen. - Franz Kafka/
> _______________________________________________
> 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]