From 6ea2d4325e0521ffb21075fbb433ce8b5c22e812 Mon Sep 17 00:00:00 2001 From: "Joshua M. Doe" Date: Tue, 14 Apr 2020 14:31:44 -0400 Subject: [PATCH] build: update Pylon to build on Linux --- CMakeLists.txt | 2 +- cmake/modules/FindPylon.cmake | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ec6df8..8a4decf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,7 +101,7 @@ find_package(Pleora) macro_log_feature(Pleora_FOUND "Pleora eBUS" "Required to build Pleora eBUS source element" "http://www.pleora.com/" FALSE) find_package(Pylon) -macro_log_feature(Pylon_FOUND "Basler Pylon" "Required to build Basler Pylon source element" "http://www.baslerweb.com/" FALSE) +macro_log_feature(PYLON_FOUND "Basler Pylon" "Required to build Basler Pylon source element" "http://www.baslerweb.com/" FALSE) find_package(Sapera) macro_log_feature(SAPERA_FOUND "Teledyne DALSA Sapera" "Required to build Teledyne DALSA Sapera source element" "http://www.teledynedalsa.com/" FALSE) diff --git a/cmake/modules/FindPylon.cmake b/cmake/modules/FindPylon.cmake index 3b2e46d..e215e96 100644 --- a/cmake/modules/FindPylon.cmake +++ b/cmake/modules/FindPylon.cmake @@ -11,18 +11,25 @@ # For details see the accompanying COPYING-CMAKE-SCRIPTS file. if (NOT PYLON_DIR) - set (PYLON_DIR "C:/Program Files/Basler/pylon 5" CACHE PATH "Directory containing Pylon SDK includes and libraries") + if (WIN32) + set (_PYLON_DIR "C:/Program Files/Basler/pylon 5") + else () + set (_PYLON_DIR "/opt/pylon5") + endif () + set (PYLON_DIR ${_PYLON_DIR} CACHE PATH "Directory containing Pylon SDK includes and libraries") endif () find_path (PYLON_INCLUDE_DIR pylonc/PylonC.h PATHS "${PYLON_DIR}/Development/include" - DOC "Directory containing KYFGLib.h include file") + "${PYLON_DIR}/include" + DOC "Directory containing PylonC.h include file") # TODO: support multiple SDK versions -find_library (_PylonCLib NAMES PylonC_MD_VC120 +find_library (_PylonCLib NAMES PylonC_MD_VC120 pylonc PATHS - "${PYLON_DIR}/Development/lib/x64") + "${PYLON_DIR}/Development/lib/x64" + "${PYLON_DIR}/lib64") set (PYLON_LIBRARIES ${_PylonCLib})