Debian Codegraph @

cmake_modules/FindAIOUSB.cmake

raw
1 # - Try to find libaiousb
2 # Once done this will define
3 #
4 # AIOUSB_FOUND - system has AIOUSB
5 # AIOUSB_INCLUDE_DIR - the AIOUSB include directory
6 # AIOUSB_LIBRARIES - Link these to use AIOUSB (C)
7 # AIOUSB_CPP_LIBRARIES - Link these to use AIOUSB (C++)
8
9 # Copyright (c) 2006, Jasem Mutlaq <[email protected]>
10 # Based on FindLibfacile by Carsten Niehaus, <[email protected]>
11 #
12 # Redistribution and use is allowed according to the terms of the BSD license.
13 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
14
15 if (AIOUSB_INCLUDE_DIR AND AIOUSB_LIBRARIES AND AIOUSB_CPP_LIBRARIES)
16
17 # in cache already
18 set(AIOUSB_FOUND TRUE)
19 message(STATUS "Found libaiusb: ${AIOUSB_LIBRARIES}")
20 message(STATUS "Found libaiusbcpp: ${AIOUSB_CPP_LIBRARIES}")
21
22 else (AIOUSB_INCLUDE_DIR AND AIOUSB_LIBRARIES AND AIOUSB_CPP_LIBRARIES)
23
24 find_path(AIOUSB_INCLUDE_DIR aiousb.h
25 ${_obIncDir}
26 ${GNUWIN32_DIR}/include
27 )
28
29 find_library(AIOUSB_LIBRARIES NAMES aiousb
30 PATHS
31 ${_obLinkDir}
32 ${GNUWIN32_DIR}/lib
33 )
34
35 find_library(AIOUSB_CPP_LIBRARIES NAMES aiousbcpp
36 PATHS
37 ${_obLinkDir}
38 ${GNUWIN32_DIR}/lib
39 )
40
41 if(AIOUSB_INCLUDE_DIR AND AIOUSB_LIBRARIES AND AIOUSB_CPP_LIBRARIES)
42 set(AIOUSB_FOUND TRUE)
43 else (AIOUSB_INCLUDE_DIR AND AIOUSB_LIBRARIES AND AIOUSB_CPP_LIBRARIES)
44 set(AIOUSB_FOUND FALSE)
45 endif(AIOUSB_INCLUDE_DIR AND AIOUSB_LIBRARIES AND AIOUSB_CPP_LIBRARIES)
46
47 if (AIOUSB_FOUND)
48 if (NOT AIOUSB_FIND_QUIETLY)
49 message(STATUS "Found libaiousb: ${AIOUSB_LIBRARIES}")
50 message(STATUS "Found libaiusbcpp: ${AIOUSB_CPP_LIBRARIES}")
51 endif (NOT AIOUSB_FIND_QUIETLY)
52 else (AIOUSB_FOUND)
53 if (AIOUSB_FIND_REQUIRED)
54 message(FATAL_ERROR "libaiousb not found. Please install libaiousb. https://www.accesio.com")
55 endif (AIOUSB_FIND_REQUIRED)
56 endif (AIOUSB_FOUND)
57
58 mark_as_advanced(AIOUSB_INCLUDE_DIR AIOUSB_LIBRARIES AIOUSB_CPP_LIBRARIES)
59
60 endif (AIOUSB_INCLUDE_DIR AND AIOUSB_LIBRARIES AND AIOUSB_CPP_LIBRARIES)
61