picotool icon indicating copy to clipboard operation
picotool copied to clipboard

Make picotool build on FreeBSD

Open arg08 opened this issue 4 years ago • 3 comments

Picotool currently doesn't quite build on FreeBSD because libusb (which is part of the base system rather than an add-on package) is just 'libusb' rather than 'libusb-1.0' even though it's compatible with the Linux -1.0 version.

So very simple patch makes it all work:

diff --git a/cmake/FindLIBUSB.cmake b/cmake/FindLIBUSB.cmake index c8cc62c..560e023 100644 --- a/cmake/FindLIBUSB.cmake +++ b/cmake/FindLIBUSB.cmake @@ -20,7 +20,7 @@ else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) ENDIF(NOT WIN32) FIND_PATH(LIBUSB_INCLUDE_DIR libusb.h PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})

  • FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0
  • FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0 usb PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS}) include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)

ie. just add "usb" after "usb-1.0" on the FIND_LIBRARY line.

arg08 avatar May 15 '21 15:05 arg08

See also raspberrypi/pico-sdk#396.

aallan avatar May 15 '21 18:05 aallan

Thanks, I've incorporated this suggestion into #27 :+1:

lurch avatar May 15 '21 19:05 lurch

Fixed by https://github.com/raspberrypi/picotool/commit/757f2aee3c2c988b4d0c9c15907e243350381d0a ?

lurch avatar Oct 05 '21 23:10 lurch

Just for note: I could build and install on Manjaro just forcing include to libusb. More: https://faelpinho.medium.com/how-to-install-picotool-on-manjaro-linux-6a5a3cfaf743

faelpinho avatar Oct 26 '23 05:10 faelpinho