Kiibohd Controller
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
Tento repozitář je archivovaný. Můžete prohlížet soubory, klonovat, ale nemůžete nahrávat a vytvářet nové úkoly a požadavky na natažení.

FindLibUSB.cmake 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Attempts to find libusb (not libusb-1.0)
  2. #
  3. # LIBUSB_FOUND - system has libusb
  4. # LIBUSB_INCLUDE_DIRS - the libusb include directory
  5. # LIBUSB_LIBRARIES - Link these to use libusb
  6. # LIBUSB_DEFINITIONS - Compiler switches required for using libusb
  7. #
  8. # Adapted from cmake-modules Google Code project
  9. #
  10. # Copyright (c) 2006 Andreas Schneider <[email protected]>
  11. #
  12. # (Changes for libusb) Copyright (c) 2014 Jacob Alexander <[email protected]>
  13. #
  14. # Redistribution and use is allowed according to the terms of the New BSD license.
  15. #
  16. # CMake-Modules Project New BSD License
  17. #
  18. # Redistribution and use in source and binary forms, with or without
  19. # modification, are permitted provided that the following conditions are met:
  20. #
  21. # * Redistributions of source code must retain the above copyright notice, this
  22. # list of conditions and the following disclaimer.
  23. #
  24. # * Redistributions in binary form must reproduce the above copyright notice,
  25. # this list of conditions and the following disclaimer in the
  26. # documentation and/or other materials provided with the distribution.
  27. #
  28. # * Neither the name of the CMake-Modules Project nor the names of its
  29. # contributors may be used to endorse or promote products derived from this
  30. # software without specific prior written permission.
  31. #
  32. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  33. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  34. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  35. # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  36. # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  37. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  38. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  39. # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  40. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  41. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  42. #
  43. if ( LIBUSB_LIBRARIES AND LIBUSB_INCLUDE_DIRS )
  44. # in cache already
  45. set( LIBUSB_FOUND TRUE )
  46. else ()
  47. find_path( LIBUSB_INCLUDE_DIR
  48. NAMES
  49. usb.h
  50. PATHS
  51. /usr/include
  52. /usr/local/include
  53. /opt/local/include
  54. /sw/include
  55. /include
  56. )
  57. find_library( LIBUSB_LIBRARY
  58. NAMES
  59. usb
  60. PATHS
  61. /usr/lib
  62. /usr/local/lib
  63. /opt/local/lib
  64. /sw/lib
  65. /lib
  66. )
  67. set( LIBUSB_INCLUDE_DIRS ${LIBUSB_INCLUDE_DIR} )
  68. set( LIBUSB_LIBRARIES ${LIBUSB_LIBRARY} )
  69. if ( LIBUSB_INCLUDE_DIRS AND LIBUSB_LIBRARIES )
  70. set( LIBUSB_FOUND TRUE )
  71. endif ()
  72. if ( LIBUSB_FOUND )
  73. if ( NOT LIBUSB_FIND_QUIETLY )
  74. message( STATUS "Found libusb:" )
  75. message( STATUS " - Includes: ${LIBUSB_INCLUDE_DIRS}" )
  76. message( STATUS " - Libraries: ${LIBUSB_LIBRARIES}" )
  77. endif ()
  78. else ()
  79. if ( LIBUSB_FIND_REQUIRED )
  80. message( FATAL_ERROR "Could not find libusb" )
  81. endif ()
  82. endif ()
  83. # show the LIBUSB_INCLUDE_DIRS and LIBUSB_LIBRARIES variables only in the advanced view
  84. mark_as_advanced( LIBUSB_INCLUDE_DIRS LIBUSB_LIBRARIES )
  85. endif ()