Fix call to CHECK_LIBRARY_EXISTS in FindbladeRF

An invalid call to the CMake macro CHECK_LIBRARY_EXISTS() in
cmake/modules/FindbladeRF.cmake prevents srsLTE to enable
support for the bladeRF driver when:
 * libbladeRF is installed to the same custom prefix we use to build
srsLTE, as with cmake -DCMAKE_INSTALL_PREFIX=/path/to/custom/prefix
 * libbladeRF is installed to /usr/local/lib BUT the linker does not
search this path by default

This trivial patch makes FindbladeRF.cmake provide the linker with the path
libbladeRF is actually installed to.
master
Dottore Spina 5 years ago committed by Andre Puschmann
parent deb3cbec28
commit 635752c42e

@ -15,7 +15,8 @@ if(NOT BLADERF_FOUND)
)
if(BLADERF_INCLUDE_DIRS AND BLADERF_LIBRARIES)
CHECK_LIBRARY_EXISTS(bladeRF bladerf_get_board_name BLADERF_LIBRARIES BLADERF_VERSION_OK)
get_filename_component(bladerf_lib_dir ${BLADERF_LIBRARIES} DIRECTORY)
CHECK_LIBRARY_EXISTS(bladeRF bladerf_get_board_name ${bladerf_lib_dir} BLADERF_VERSION_OK)
if (BLADERF_VERSION_OK)
set(BLADERF_FOUND TRUE CACHE INTERNAL "libbladeRF found")
message(STATUS "Found libbladeRF: ${BLADERF_INCLUDE_DIRS}, ${BLADERF_LIBRARIES}")

Loading…
Cancel
Save