Skip to content

Instantly share code, notes, and snippets.

@shabaz123
Created January 15, 2024 23:42
Show Gist options
  • Save shabaz123/193cafaa632d2c6fbb95ba0bf60e745d to your computer and use it in GitHub Desktop.
Save shabaz123/193cafaa632d2c6fbb95ba0bf60e745d to your computer and use it in GitHub Desktop.
cmake file used for building libmirisdr-4
# FindLibUSB.cmake - Try to find the Hiredis library
# Once done this will define
#
# LIBUSB_FOUND - System has libusb
# LIBUSB_INCLUDE_DIR - The libusb include directory
# LIBUSB_LIBRARIES - The libraries needed to use libusb
# LIBUSB_DEFINITIONS - Compiler switches required for using libusb
find_path(LIBUSB_INCLUDE_DIR
NAMES libusb.h
PATHS
/usr
/usr/local
/opt
C:\\development\\miri_sdr\\libusb-1.0.26-binaries\\libusb-MinGW-Win32\\include\\libusb-1.0
"${CMAKE_BINARY_DIR}\\include"
PATH_SUFFIXES libusb-1.0
)
SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
find_library(LIBUSB_LIBRARIES
NAMES usb-1.0
PATHS
/usr
/usr/local
/opt
C:\\development\\miri_sdr\\libusb-1.0.26-binaries\\libusb-MinGW-Win32\\bin
"${CMAKE_BINARY_DIR}/MS64/static"
"${CMAKE_BINARY_DIR}/MS64/dll"
)
message(${LIBUSB_INCLUDE_DIR})
message("${CMAKE_BINARY_DIR}\\MS64\\dll")
message("LIBUSB_LIBRARIES: ${LIBUSB_LIBRARIES}")
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Libusb DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
MARK_AS_ADVANCED(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment