# - Try to find libPvAPI
#
#  PVAPI_FOUND - system has libPvAPI
#  PVAPI_INCLUDE_DIR - the libPvAPI include directories
#  PVAPI_LIBRARY - link these to use libPvAPI

FIND_PATH(
  PVAPI_INCLUDE_DIR
  NAMES PvApi.h
  PATHS
    "${CMAKE_SOURCE_DIR}/../AVT GigE SDK/inc-pc"
    "${CMAKE_SOURCE_DIR}/../../../AVT GigE SDK/inc-pc"
    /usr/include/PvAPI
    /usr/local/include/PvAPI
)

FIND_LIBRARY(
  PVAPI_LIBRARIES
  NAMES PvAPI
  PATHS
    "${CMAKE_SOURCE_DIR}/../AVT GigE SDK/lib-pc/x64/4.2"
    "${CMAKE_SOURCE_DIR}/../../../AVT GigE SDK/lib-pc/x64/4.2"
    /usr/lib
    /usr/local/lib
) 

IF (PVAPI_INCLUDE_DIR AND PVAPI_LIBRARIES)
   SET(PVAPI_FOUND TRUE)
ENDIF (PVAPI_INCLUDE_DIR AND PVAPI_LIBRARIES)

IF (PVAPI_FOUND)
   IF (NOT PVAPI_FIND_QUIETLY)
      MESSAGE(STATUS "Found PvAPI: ${PVAPI_LIBRARIES}")
   ENDIF (NOT PVAPI_FIND_QUIETLY)
ELSE (PVAPI_FOUND)
   IF (PVAPI_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find PvAPI")
   ENDIF (PVAPI_FIND_REQUIRED)
ENDIF (PVAPI_FOUND)
