Hello,

On 2024-05-29 11:32 +0000, je.amg...@gmail.com wrote:
> After developing a C++ program and placing it in
> **`/uhd/host/utils`**, I included it in **`CMakeLists.txt`**. However,
> when attempting to build the program using **`make`** within
> **`/uhd/host/build`**, UHD is reporting that it's unable to locate the
> C++ library I've used, specifically when including
> <libserial/SerialStream.h> and <libserial/SerialPort.h> (libserial
> library).\
> \
> How can I specify to UHD the location of the libraries I utilize in my
> programs?\

I think you have to add another `target_link_libraries` [1] in the CMakeLists,
or modify the one already there ([2] or [3], depending on which set you
included your file).
I.e. one of these two:
 - add `target_link_libraries(<filename_without_extension> serial)`
 - append `serial` in [2] or [3]

[1] https://cmake.org/cmake/help/latest/command/target_link_libraries.html
[2] 
https://github.com/EttusResearch/uhd/blob/041eef3472e0440730708053d47b1fb7b793c682/host/utils/CMakeLists.txt#L120
[3] 
https://github.com/EttusResearch/uhd/blob/041eef3472e0440730708053d47b1fb7b793c682/host/utils/CMakeLists.txt#L188

Best regards
-- 

Cédric Hannotier
_______________________________________________
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-le...@lists.ettus.com

Reply via email to