Home | History | Annotate | Download | only in modules
      1 # - Try to find LIBFT4222
      2 # Once done this will define
      3 #
      4 #  LIBFT4222_FOUND - system has LIBFT4222
      5 #  LIBFT4222_INCLUDE_DIRS - the LIBFT4222 include directory
      6 #  LIBFT4222_LIBRARIES - Link these to use LIBFT4222
      7 #  LIBFT4222_DEFINITIONS - Compiler switches required for using LIBFT4222
      8 #
      9 #  Adapted from cmake-modules Google Code project
     10 #
     11 #  Copyright (c) 2006 Andreas Schneider <mail (a] cynapses.org>
     12 #
     13 #  (Changes for LIBFTD2XX) Copyright (c) 2008 Kyle Machulis <kyle (a] nonpolynomial.com>
     14 #  (Changes for LIBFT4222) Henry Bruce <henry.bruce (a] intel.com> Copyright (c) 2015 Intel Corporation. 
     15 #
     16 # Redistribution and use is allowed according to the terms of the New BSD license.
     17 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
     18 
     19 if (LIBFT4222_LIBRARIES AND LIBFT4222_INCLUDE_DIRS)
     20   # in cache already
     21   set(LIBFT4222_FOUND TRUE)
     22 else (LIBFT4222_LIBRARIES AND LIBFT4222_INCLUDE_DIRS)
     23   find_path(LIBFT4222_INCLUDE_DIR
     24     NAMES
     25     libft4222.h
     26     PATHS
     27     /usr/include
     28     /usr/local/include
     29     /opt/local/include
     30     /sw/include
     31 	)
     32 
     33   SET(FTD4222_LIBNAME ft4222)
     34   IF(WIN32)
     35 	SET(FTD4222_LIBNAME LibFT4222.lib)
     36   ENDIF(WIN32)
     37 
     38   find_library(LIBFT4222_LIBRARY
     39     NAMES
     40     ${FTD4222_LIBNAME}
     41     PATHS
     42     /usr/lib
     43     /usr/local/lib
     44     /opt/local/lib
     45     /sw/lib
     46 	)
     47 
     48   if(LIBFT4222_INCLUDE_DIR)
     49 	set(LIBFT4222_INCLUDE_DIRS
     50       ${LIBFT4222_INCLUDE_DIR}
     51 	  )
     52   endif(LIBFT4222_INCLUDE_DIR)
     53   set(LIBFT4222_LIBRARIES
     54     ${LIBFT4222_LIBRARY}
     55 	)
     56 
     57   if (LIBFT4222_INCLUDE_DIRS AND LIBFT4222_LIBRARIES)
     58     set(LIBFT4222_FOUND TRUE)
     59   endif (LIBFT4222_INCLUDE_DIRS AND LIBFT4222_LIBRARIES)
     60 
     61   if (LIBFT4222_FOUND)
     62     if (NOT LIBFT4222_FIND_QUIETLY)
     63 	  message(STATUS "Found LIBFT4222: ${LIBFT4222_LIBRARIES}")
     64     endif (NOT LIBFT4222_FIND_QUIETLY)
     65   else (LIBFT4222_FOUND)
     66     if (LIBFT4222_FIND_REQUIRED)
     67 	  message(FATAL_ERROR "Could not find LIBFT4222")
     68     endif (LIBFT4222_FIND_REQUIRED)
     69   endif (LIBFT4222_FOUND)
     70 
     71   # show the LIBFT4222_INCLUDE_DIRS and LIBFT4222_LIBRARIES variables only in the advanced view
     72   mark_as_advanced(LIBFT4222_INCLUDE_DIRS LIBFT4222_LIBRARIES)
     73 
     74 endif (LIBFT4222_LIBRARIES AND LIBFT4222_INCLUDE_DIRS)
     75 
     76