summaryrefslogtreecommitdiffstats
path: root/cmake/FindPylon.cmake
blob: e096bb4aa9b517edf767f20bb08632aef656196a (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
33
34
35
36
37

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

# check for environment variable PYLON_ROOT
find_package(YAT)
find_package(PkgConfig)
find_package(PackageHandleStandardArgs)

if (NOT "$ENV{PYLON_ROOT}" STREQUAL "")
  find_library(YAT_LIB yat ${YAT_LIBRARY_DIRS})

  pkg_check_modules(LIBPYLONCAM pyloncam>=0.1)

  if (DEFINED LIBPYLONCAM_OTHER_PREFIX)
    string(REPLACE ${LIBPYLONCAM_PREFIX} ${LIBPYLONCAM_OTHER_PREFIX}
      LIBPYLONCAM_INCLUDEDIR ${LIBPYLONCAM_INCLUDEDIR})
    string(REPLACE ${LIBPYLONCAM_PREFIX} ${LIBPYLONCAM_OTHER_PREFIX}
      LIBPYLONCAM_LIBRARIES ${LIBPYLONCAM_LIBRARIES})
    string(REPLACE ${LIBPYLONCAM_PREFIX} ${LIBPYLONCAM_OTHER_PREFIX}
      LIBPYLONCAM_LIBDIR ${LIBPYLONCAM_LIBDIR})
    set(LIBPYLONCAM_LIBDIR ${LIBPYLONCAM_LIBDIR} PARENT_SCOPE)
  endif()

  find_package_handle_standard_args(PYLON DEFAULT_MSG LIBPYLONCAM_INCLUDEDIR LIBPYLONCAM_LIBRARIES)

  mark_as_advanced(
    LIBPYLONCAM_INCLUDEDIR
    LIBPYLONCAM_LIBRARIES
    LIBPYLONCAM_LIBDIR)
endif()
message("-- Pylon libraries found: ${PYLON_FOUND}")