Description: Handle Debian kFreeBSD architecture.
Author: A. Maitland Bottoms <bottoms@debian.org>

--- a/host/cmake/modules/FindLibUSB.cmake
+++ b/host/cmake/modules/FindLibUSB.cmake
@@ -48,18 +48,15 @@
 endif()
 
 # FreeBSD has built-in libusb since 800069
-if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+if((${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") OR (${CMAKE_SYSTEM_NAME} MATCHES "kFreeBSD") )
   exec_program(sysctl ARGS -n kern.osreldate OUTPUT_VARIABLE FREEBSD_VERSION)
-  set(MIN_FREEBSD_VERSION 800068)
-  if(FREEBSD_VERSION GREATER ${MIN_FREEBSD_VERSION})
-    set(LIBUSB_FOUND TRUE)
-    set(LIBUSB_SKIP_VERSION_CHECK TRUE)
-    set(LIBUSB_INCLUDE_DIRS "/usr/include")
-    set(LIBUSB_HEADER_FILE "${LIBUSB_INCLUDE_DIRS}/libusb.h")
-    set(LIBUSB_LIBRARIES "usb")
-    set(LIBUSB_LIBRARY_DIRS "/usr/lib/")
-  endif(FREEBSD_VERSION GREATER ${MIN_FREEBSD_VERSION})
-endif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+  set(LIBUSB_FOUND TRUE)
+  set(LIBUSB_SKIP_VERSION_CHECK TRUE)
+  set(LIBUSB_INCLUDE_DIRS "/usr/include")
+  set(LIBUSB_HEADER_FILE "${LIBUSB_INCLUDE_DIRS}/libusb.h")
+  set(LIBUSB_LIBRARIES "usb")
+  set(LIBUSB_LIBRARY_DIRS "/usr/lib/")
+endif((${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") OR (${CMAKE_SYSTEM_NAME} MATCHES "kFreeBSD") )
 
 find_package(PkgConfig)
 if(PKG_CONFIG_FOUND)
--- a/host/libraries/libbladeRF/CMakeLists.txt
+++ b/host/libraries/libbladeRF/CMakeLists.txt
@@ -494,17 +494,18 @@
     @ONLY
 )
 
-if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+if((${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") AND NOT (CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD"))
 install(
     FILES ${CMAKE_CURRENT_BINARY_DIR}/libbladeRF.pc
     DESTINATION ${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig
 )
 else()
+# Debian kFreeBSD uses the same location as Debian Linux
 install(
     FILES ${CMAKE_CURRENT_BINARY_DIR}/libbladeRF.pc
     DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/
 )
-endif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+endif((${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") AND NOT (CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD"))
 
 
 ################################################################################
