ucsdsysnet / sparsdr

68 stars 10 forks source link

CMake: No UHD::uhd exported target #23

Open samcrow opened 2 years ago

samcrow commented 2 years ago

On some systems, the FindUHD.cmake file that's already installed runs and finds UHD, but does not produce a UHD::uhd exported target.

We should look at that FindUHD.cmake file and see what it does. This might require going back to the old method of linking libraries and adding include directories.

sada45 commented 2 years ago

Hi! I went through the same issue. My system is Ubuntu 20.04, and the UHD version is 4.1.0. Is there any quick fix I can do to try this example? And I have no idea where to find the FindUHD.cmake.

samcrow commented 2 years ago

For a short-term fix, try removing the UHD::uhd line from gr-sparsdr/lib/CMakeLists.txt. That worked for one person.

To help me reproduce your exact problem and check that the fix works, what version of GNU Radio do you have? What method did you use to install GNU Radio and UHD?

salik1990 commented 3 months ago

CMake Error at lib/CMakeLists.txt:58 (add_library): Trying to build sparsdr with gnuradio3.10 and ubuntu 22.04 and getting this error. UHD is installed also tried this: cmake -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu/cmake/uhd ..

but still problem is remained same:

Target "gnuradio-sparsdr" links to target "UHD::uhd" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at /usr/local/lib/cmake/gnuradio/GrTest.cmake:163 (add_executable): Target "sparsdr_qa_threshold_file.cc" links to target "UHD::uhd" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? Call Stack (most recent call first): lib/CMakeLists.txt:116 (GR_ADD_CPP_TEST)

Any Fix yet plz.

samcrow commented 3 months ago

What version of UHD do you have, and how did you install it?