You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.6 KiB

  1. --- a/CMakeLists.txt
  2. +++ b/CMakeLists.txt
  3. @@ -476,20 +476,23 @@ else()
  4. MESSAGE(FATAL_ERROR "cURL not found on your system, see install.txt how to get them installed. (for example 'sudo apt-get install curl libcurl4-openssl-dev')")
  5. ENDIF(CURL_FOUND)
  6. -find_path(LIBUSB_INCLUDE_DIR usb.h
  7. - HINTS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
  8. -find_library(LIBUSB_LIBRARY NAMES usb
  9. - HINTS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
  10. -set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARY})
  11. +option(WITH_LIBUSB "Enable libusb support" NO)
  12. + if(WITH_LIBUSB)
  13. + find_path(LIBUSB_INCLUDE_DIR usb.h
  14. + HINTS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
  15. + find_library(LIBUSB_LIBRARY NAMES usb
  16. + HINTS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
  17. + set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARY})
  18. -find_package_handle_standard_args(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
  19. -IF(LIBUSB_FOUND)
  20. - MESSAGE(STATUS "LIBUSB found at: ${LIBUSB_LIBRARIES}")
  21. - add_definitions(-DWITH_LIBUSB)
  22. - target_link_libraries(domoticz ${LIBUSB_LIBRARIES})
  23. -else()
  24. - MESSAGE(STATUS "==== LibUSB not found, support for TE923/Voltcraft disabled!")
  25. -ENDIF(LIBUSB_FOUND)
  26. + find_package_handle_standard_args(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
  27. + IF(LIBUSB_FOUND)
  28. + MESSAGE(STATUS "LIBUSB found at: ${LIBUSB_LIBRARIES}")
  29. + add_definitions(-DWITH_LIBUSB)
  30. + target_link_libraries(domoticz ${LIBUSB_LIBRARIES})
  31. + else()
  32. + MESSAGE(STATUS "==== LibUSB not found, support for TE923/Voltcraft disabled!")
  33. + ENDIF(LIBUSB_FOUND)
  34. +endif(WITH_LIBUSB)
  35. #
  36. # Find MD5/RMD160/SHA library