Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: No UHD::uhd exported target #23

Open
samcrow opened this issue Mar 10, 2022 · 4 comments
Open

CMake: No UHD::uhd exported target #23

samcrow opened this issue Mar 10, 2022 · 4 comments
Labels
bug Something isn't working cmake Problems with the CMake build system

Comments

@samcrow
Copy link
Collaborator

samcrow commented Mar 10, 2022

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.

@samcrow samcrow added bug Something isn't working cmake Problems with the CMake build system labels Mar 10, 2022
@sada45
Copy link

sada45 commented Mar 29, 2022

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
Copy link
Collaborator Author

samcrow commented Apr 8, 2022

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
Copy link

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
Copy link
Collaborator Author

samcrow commented Aug 27, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cmake Problems with the CMake build system
Projects
None yet
Development

No branches or pull requests

3 participants