Skip to content
Snippets Groups Projects
Commit 7375d094 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Cmake for pylon

parent c6a44351
No related branches found
No related tags found
1 merge request!312Support new basler cameras
Pipeline #27155 passed
...@@ -10,6 +10,7 @@ include(GNUInstallDirs) ...@@ -10,6 +10,7 @@ include(GNUInstallDirs)
include(CTest) include(CTest)
enable_testing() enable_testing()
option(WITH_PYLON "Use Pylon for Basler cameras" ON)
option(WITH_OPTFLOW "Use NVIDIA Optical Flow if available" OFF) option(WITH_OPTFLOW "Use NVIDIA Optical Flow if available" OFF)
option(WITH_OPENVR "Build with OpenVR support" OFF) option(WITH_OPENVR "Build with OpenVR support" OFF)
option(WITH_OPUS "Use Opus audio compression" ON) option(WITH_OPUS "Use Opus audio compression" ON)
...@@ -48,6 +49,10 @@ find_package( URIParser REQUIRED ) ...@@ -48,6 +49,10 @@ find_package( URIParser REQUIRED )
find_package( MsgPack REQUIRED ) find_package( MsgPack REQUIRED )
find_package( Eigen3 REQUIRED ) find_package( Eigen3 REQUIRED )
if (WITH_PYLON)
find_package( Pylon )
endif()
VERSION_STR_TO_INTS(OPENCV_MAJOR OPENCV_MINOR OPENCV_PATCH ${OpenCV_VERSION}) VERSION_STR_TO_INTS(OPENCV_MAJOR OPENCV_MINOR OPENCV_PATCH ${OpenCV_VERSION})
math(EXPR OPENCV_NUMBER "(${OPENCV_MAJOR} * 10000) + (${OPENCV_MINOR} * 100) + ${OPENCV_PATCH}") math(EXPR OPENCV_NUMBER "(${OPENCV_MAJOR} * 10000) + (${OPENCV_MINOR} * 100) + ${OPENCV_PATCH}")
......
###############################################################################
# Find Pylon
#
set(PYLON_FOUND FALSE CACHE BOOL "" FORCE)
if(WIN32)
find_path(PYLON_DIR NAMES include/pylon/PylonBase.h PATHS "C:/Program Files/Pylon" "C:/Program Files (x86)/Pylon")
else()
find_path(PYLON_DIR NAMES include/pylon/PylonBase.h PATHS "/opt/pylon" "/opt/pylon6")
endif()
if (PYLON_DIR)
set(PYLON_FOUND TRUE CACHE BOOL "" FORCE)
set(HAVE_PYLON TRUE)
# Find lib dir
# Find include
find_path(PYLON_LIBRARY_DIRS
NAMES libpylonbase.so
PATHS ${PYLON_DIR}
PATH_SUFFIXES lib
)
# Find include
find_path(PYLON_INCLUDE_DIRS
NAMES pylon/PylonBase.h
PATHS ${PYLON_DIR}
PATH_SUFFIXES include
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Pylon DEFAULT_MSG PYLON_DIR)
mark_as_advanced(PYLON_FOUND)
mark_as_advanced(PYLON_INCLUDE_DIRS)
mark_as_advanced(PYLON_LIBRARY_DIRS)
list(APPEND PYLON_LIBRARIES pylonbase pylonutility GenApi_gcc_v3_1_Basler_pylon GCBase_gcc_v3_1_Basler_pylon)
add_library(Pylon UNKNOWN IMPORTED)
set_property(TARGET Pylon PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PYLON_INCLUDE_DIRS})
set_property(TARGET Pylon PROPERTY INTERFACE_LINK_DIRECTORIES ${PYLON_INCLUDE_DIRS})
set_property(TARGET Pylon PROPERTY INTERFACE_LINK_LIBRARIES ${PYLON_LIBRARIES})
else()
add_library(Pylon INTERFACE)
endif()
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#cmakedefine HAVE_PORTAUDIO #cmakedefine HAVE_PORTAUDIO
#cmakedefine HAVE_X11 #cmakedefine HAVE_X11
#cmakedefine HAVE_OPUS #cmakedefine HAVE_OPUS
#cmakedefine HAVE_PYLON
#cmakedefine ENABLE_PROFILER #cmakedefine ENABLE_PROFILER
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment