Use library paths from pkg-config #4
Loading…
Reference in New Issue
No description provided.
Delete Branch "argilo/rtl-sdr:libusb-pkgconfig"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When using pkg-config, it is not possible to link to libusb if it is in a non-standard location. This worked prior to
0847e93e08
becausePkgConfig::LIBUSB
provided the path to the library, but theLIBUSB_LIBRARIES
variable set bypkg_check_modules
only includes the library name and not the path. TheLIBUSB_LINK_LIBRARIES
variable set bypkg_check_modules
includes the path, so we can resolve the problem (while retaining the existingLIBUSB_LIBRARIES
variable for non-pkg-config installs) by copyingLIBUSB_LINK_LIBRARIES
intoLIBUSB_LIBRARIES
.I just noticed that this only works with CMake >= 3.12 because prior versions don't set
<XXX>_LINK_LIBRARIES
.Unfortunately I can't reach
gitea-ssh.osmocom.org
to push a fix to my fork, but perhaps you could apply the following patch, which avoids overwritingLIBUSB_LIBRARIES
ifLIBUSB_LINK_LIBRARIES
doesn't exist:Pushed, thanks!