INCLUDE(FindPackageHandleStandardArgs)

FIND_LIBRARY(GENICAM_LIBRARY_2_1 GenApi_gcc40_v2_1
  /opt/pylon/genicam/bin/Linux64_x64
)

FIND_LIBRARY(GENICAM_LIBRARY_1_1 genicam_api
  /opt/pylon/lib64
)

IF (GENICAM_LIBRARY_1_1 OR GENICAM_LIBRARY_2_1)
  IF(GENICAM_LIBRARY_2_1)
    SET(GENICAM_LIBRARY ${GENICAM_LIBRARY_2_1})
  ELSE(GENICAM_LIBRARY_2_1)
    SET(GENICAM_LIBRARY ${GENICAM_LIBRARY_1_1})
  ENDIF(GENICAM_LIBRARY_2_1)
ENDIF (GENICAM_LIBRARY_1_1 OR GENICAM_LIBRARY_2_1)

FIND_PATH(GENICAM_INCLUDE_PATH genapi-config.h
  "$ENV{GENICAM_INCLUDE_PATH}"
  /opt/pylon/genicam/library/CPP/include
  /opt/pylon/include/genicam
)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(GENICAM DEFAULT_MSG
  GENICAM_INCLUDE_PATH
  GENICAM_LIBRARY)

