1 # - Try to find libftd2xx
2 # Once done this will define
4 # LIBFTD2XX_FOUND - system has libftd2xx
5 # LIBFTD2XX_INCLUDE_DIRS - the libftd2xx include directory
6 # LIBFTD2XX_LIBRARIES - Link these to use libftd2xx
7 # LIBFTD2XX_DEFINITIONS - Compiler switches required for using libftd2xx
9 # Adapted from cmake-modules Google Code project
11 # Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
13 # (Changes for libftd2xx) Copyright (c) 2008 Kyle Machulis <kyle@nonpolynomial.com>
15 # Redistribution and use is allowed according to the terms of the New BSD license.
16 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
18 if (LIBFTD2XX_LIBRARIES AND LIBFTD2XX_INCLUDE_DIRS)
20 set(LIBFTD2XX_FOUND TRUE)
21 else (LIBFTD2XX_LIBRARIES AND LIBFTD2XX_INCLUDE_DIRS)
22 find_path(LIBFTD2XX_INCLUDE_DIR
32 SET(FTD2XX_LIBNAME ftd2xx)
34 SET(FTD2XX_LIBNAME ftd2xx.lib)
37 find_library(LIBFTD2XX_LIBRARY
47 if(LIBFTD2XX_INCLUDE_DIR)
48 set(LIBFTD2XX_INCLUDE_DIRS
49 ${LIBFTD2XX_INCLUDE_DIR}
51 endif(LIBFTD2XX_INCLUDE_DIR)
52 set(LIBFTD2XX_LIBRARIES
56 if (LIBFTD2XX_INCLUDE_DIRS AND LIBFTD2XX_LIBRARIES)
57 set(LIBFTD2XX_FOUND TRUE)
58 endif (LIBFTD2XX_INCLUDE_DIRS AND LIBFTD2XX_LIBRARIES)
61 if (NOT libftd2xx_FIND_QUIETLY)
62 message(STATUS "Found libftd2xx: ${LIBFTD2XX_LIBRARIES}")
63 endif (NOT libftd2xx_FIND_QUIETLY)
64 else (LIBFTD2XX_FOUND)
65 if (libftd2xx_FIND_REQUIRED)
66 message(FATAL_ERROR "Could not find libftd2xx")
67 endif (libftd2xx_FIND_REQUIRED)
68 endif (LIBFTD2XX_FOUND)
70 # show the LIBFTD2XX_INCLUDE_DIRS and LIBFTD2XX_LIBRARIES variables only in the advanced view
71 mark_as_advanced(LIBFTD2XX_INCLUDE_DIRS LIBFTD2XX_LIBRARIES)
73 endif (LIBFTD2XX_LIBRARIES AND LIBFTD2XX_INCLUDE_DIRS)