Add better FindLibUsb support for MacOSX.

Make LibUSB optional, don't compile HID support if it doesn't exist.
A lot less hacky. Works quite well on Ubuntu now.
This commit is contained in:
Matthew Parlane
2012-12-30 16:57:37 +13:00
parent 13bd235c11
commit 3b459fb500
6 changed files with 85 additions and 80 deletions

View File

@ -427,11 +427,11 @@ else(SDL2_FOUND)
endif(SDL_FOUND)
endif(SDL2_FOUND)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
include(FindLibUSB OPTIONAL)
endif()
include(FindLibUSB OPTIONAL)
if(LIBUSB_FOUND)
message("Using shared LibUSB")
add_definitions(-D__LIBUSB__)
include_directories(${LIBUSB_INCLUDE_DIR})
else(LIBUSB_FOUND)