summaryrefslogtreecommitdiffstats
path: root/cmake/FindPylon.cmake
blob: be3ce856cabfed56278d346d8a99866e0754463b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

# Try to find libpco.so
#
# Defines
#
# PYLON_FOUND - system has libpco
# PYLON_INCLUDE_DIR - libpco include directory
# PYLON_LIB - pco library

# check for environment variable PYLON_ROOT
message("DEFINED PYLON ROOT $ENV{PYLON_ROOT}")
if (NOT "$ENV{PYLON_ROOT}" STREQUAL "")
  message("PYLON_ROOT=$ENV{PYLON_ROOT}")
  set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:$ENV{PYLON_ROOT}/lib")
  set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH};$ENV{PYLON_ROOT}/lib64")
  set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH};$ENV{PYLON_ROOT}/genicam/bin/Linux64_x64")
  set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH};$ENV{PYLON_ROOT}/genicam/bin/Linux32_i86")


  find_package(YAT)
  find_package(PackageHandleStandardArgs)

  find_path(PYLON_INCLUDE_DIR libpyloncam/pylon_camera.h)
  find_library(PYLON_LIB pyloncam)

  message("INCLUDE ${PYLON_INCLUDE_DIR}")

  find_package_handle_standard_args(PYLON DEFAULT_MSG PYLON_LIB PYLON_INCLUDE_DIR)

else()
  message("Environment variable PYLON_ROOT not found! => unable to build pylon camera support")
endif()