Debian Codegraph @

cmake_modules/FindD2XX.cmake

raw
1 # - Try to find D2XX
2 # Once done this will define
3 #
4 # D2XX_FOUND - system has FTDI
5 # D2XX_INCLUDE_DIR - the FTDI include directory
6 # D2XX_LIBRARIES - Link these to use FTDI
7 #
8 # N.B. You must include the file as following:
9 #
10 #include <ftd2xx.h>
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 (D2XX_INCLUDE_DIR AND D2XX_LIBRARIES)
16
17 # in cache already
18 set(D2XX_FOUND TRUE)
19 message(STATUS "Found libfd2xx: ${D2XX_LIBRARIES}")
20
21 else (D2XX_INCLUDE_DIR AND D2XX_LIBRARIES)
22
23 find_path(D2XX_INCLUDE_DIR ftd2xx.h
24 #PATH_SUFFIXES libD2XX
25 ${_obIncDir}
26 ${GNUWIN32_DIR}/include
27 /usr/local/include
28 )
29
30 find_library(D2XX_LIBRARIES NAMES ftd2xx
31 PATHS
32 ${_obLinkDir}
33 ${GNUWIN32_DIR}/lib
34 /usr/local/lib
35 )
36
37 if(D2XX_INCLUDE_DIR AND D2XX_LIBRARIES)
38 set(D2XX_FOUND TRUE)
39 else (D2XX_INCLUDE_DIR AND D2XX_LIBRARIES)
40 set(D2XX_FOUND FALSE)
41 endif(D2XX_INCLUDE_DIR AND D2XX_LIBRARIES)
42
43
44 if (D2XX_FOUND)
45 if (NOT D2XX_FIND_QUIETLY)
46 message(STATUS "Found D2XX: ${D2XX_LIBRARIES}")
47 endif (NOT D2XX_FIND_QUIETLY)
48 else (D2XX_FOUND)
49 if (D2XX_FIND_REQUIRED)
50 message(FATAL_ERROR "D2XX not found. Please install libd2xx")
51 endif (D2XX_FIND_REQUIRED)
52 endif (D2XX_FOUND)
53
54 mark_as_advanced(D2XX_INCLUDE_DIR D2XX_LIBRARIES)
55
56 endif (D2XX_INCLUDE_DIR AND D2XX_LIBRARIES)