~registry/dolphin-emu/triforce

« back to all changes in this revision

Viewing changes to CMakeTests/FindLibUSB.cmake

  • Committer: Sérgio Benjamim
  • Date: 2015-02-13 05:54:40 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20150213055440-ey2rt3sjpy27km78
Dolphin Triforce branch from code.google, commit b957980 (4.0-315).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# - Find libusb-1.0 library
 
2
# This module defines
 
3
#  LIBUSB_INCLUDE_DIR, where to find bluetooth.h
 
4
#  LIBUSB_LIBRARIES, the libraries needed to use libusb-1.0.
 
5
#  LIBUSB_FOUND, If false, do not try to use libusb-1.0.
 
6
#
 
7
# Copyright (c) 2009, Michal Cihar, <michal@cihar.com>
 
8
#
 
9
# vim: expandtab sw=4 ts=4 sts=4:
 
10
 
 
11
if(ANDROID)
 
12
       set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found")
 
13
       message(STATUS "libusb-1.0 not found.")
 
14
elseif (NOT LIBUSB_FOUND)
 
15
    pkg_check_modules (LIBUSB_PKG libusb-1.0)
 
16
 
 
17
    find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h
 
18
       PATHS
 
19
       ${LIBUSB_PKG_INCLUDE_DIRS}
 
20
       /usr/include/libusb-1.0
 
21
       /usr/include
 
22
       /usr/local/include/libusb-1.0
 
23
       /usr/local/include
 
24
    )
 
25
 
 
26
    find_library(LIBUSB_LIBRARIES NAMES usb-1.0
 
27
       PATHS
 
28
       ${LIBUSB_PKG_LIBRARY_DIRS}
 
29
       /usr/lib
 
30
       /usr/local/lib
 
31
    )
 
32
 
 
33
    if(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
 
34
       set(LIBUSB_FOUND TRUE CACHE INTERNAL "libusb-1.0 found")
 
35
       message(STATUS "Found libusb-1.0: ${LIBUSB_INCLUDE_DIR}, ${LIBUSB_LIBRARIES}")
 
36
    else(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
 
37
       set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found")
 
38
       message(STATUS "libusb-1.0 not found.")
 
39
    endif(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
 
40
 
 
41
    mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
 
42
endif ()
 
43