From 1f845a3634ae34b79e1b4421b72f1a916c775cc6 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Mon, 18 Mar 2019 22:45:44 +0000 Subject: [PATCH] Don't try to build libusb on FreeBSD CMake Error at 3rdparty/libusb/libusb/os/CMakeLists.txt:90 (message): Unsupported platform FreeBSD. Currently only support Windows, OSX, & Linux. --- 3rdparty/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 905a86603e..9091c34ba1 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -87,7 +87,13 @@ endif() # libusb -add_subdirectory(libusb EXCLUDE_FROM_ALL) +if(CMAKE_SYSTEM MATCHES "DragonFly|FreeBSD") + # Always use system libusb as reference implementation isn't supported + add_library(usb-1.0-static INTERFACE) + target_link_libraries(usb-1.0-static INTERFACE usb) +else() + add_subdirectory(libusb EXCLUDE_FROM_ALL) +endif() # yaml-cpp