From 8559af55c5ca4f3635f75c2bf446fbe3d507666e Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Thu, 11 Oct 2018 08:48:22 +0200 Subject: [PATCH] Detect BladeRF Micro compatible drivers --- cmake/modules/FindbladeRF.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/modules/FindbladeRF.cmake b/cmake/modules/FindbladeRF.cmake index b154a9cf1..565603000 100644 --- a/cmake/modules/FindbladeRF.cmake +++ b/cmake/modules/FindbladeRF.cmake @@ -15,8 +15,14 @@ if(NOT BLADERF_FOUND) ) if(BLADERF_INCLUDE_DIRS AND BLADERF_LIBRARIES) - set(BLADERF_FOUND TRUE CACHE INTERNAL "libbladeRF found") - message(STATUS "Found libbladeRF: ${BLADERF_INCLUDE_DIRS}, ${BLADERF_LIBRARIES}") + CHECK_LIBRARY_EXISTS(bladeRF bladerf_get_board_name BLADERF_LIBRARIES BLADERF_VERSION_OK) + if (BLADERF_VERSION_OK) + set(BLADERF_FOUND TRUE CACHE INTERNAL "libbladeRF found") + message(STATUS "Found libbladeRF: ${BLADERF_INCLUDE_DIRS}, ${BLADERF_LIBRARIES}") + else (BLADERF_VERSION_OK) + set(BLADERF_FOUND FALSE CACHE INTERNAL "libbladeRF found") + message(STATUS "libbladeRF found but not compatible. Upgrade your driver or use SoapySDR.") + endif (BLADERF_VERSION_OK) else(BLADERF_INCLUDE_DIRS AND BLADERF_LIBRARIES) set(BLADERF_FOUND FALSE CACHE INTERNAL "libbladeRF found") message(STATUS "libbladeRF not found.")