pleora: build for various versions of eBUS, and append version to plugin name
Not the prettiest way to handle this, but we have a need for supporting multiple versions of eBUS, and this way we can distribute multiple versions. This also tries to modernize the FindPleora.cmake file.
This commit is contained in:
parent
0fc4bc182c
commit
7292eaf353
@ -98,7 +98,7 @@ find_package(Phoenix)
|
||||
macro_log_feature(PHOENIX_FOUND "Active Silicon Phoenix" "Required to build Active Silicon Phoenix source element" "http://www.activesilicon.com/" FALSE)
|
||||
|
||||
find_package(Pleora)
|
||||
macro_log_feature(PLEORA_FOUND "Pleora eBUS" "Required to build Pleora eBUS source element" "http://www.pleora.com/" FALSE)
|
||||
macro_log_feature(Pleora_FOUND "Pleora eBUS" "Required to build Pleora eBUS source element" "http://www.pleora.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)
|
||||
|
||||
@ -1,18 +1,19 @@
|
||||
# - Try to find Pleora SDK
|
||||
# Once done this will define
|
||||
#
|
||||
# PLEORA_FOUND - system has Pleora SDK
|
||||
# PLEORA_INCLUDE_DIR - the Pleora SDK include directory
|
||||
# PLEORA_LIBRARIES_DIR - the Pleora SDK libraries directory
|
||||
# Pleora_FOUND - system has Pleora SDK
|
||||
# Pleora_INCLUDE_DIR - the Pleora SDK include directory
|
||||
# Pleora_LIBRARIES - the Pleora SDK libraries
|
||||
# Pleora_LIBRARY_DIR - the Pleora SDK library directory
|
||||
|
||||
# Copyright (c) 2006, Tim Beaulen <tbscope@gmail.com>
|
||||
# Copyright (c) 2016 outside US, United States Government, Joshua M. Doe <oss@nvl.army.mil>
|
||||
# Copyright (c) 2019 outside US, United States Government, Joshua M. Doe <oss@nvl.army.mil>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
if (NOT PLEORA_DIR)
|
||||
set (PLEORA_DIR $ENV{PUREGEV_ROOT} CACHE PATH "Directory containing Pleora SDK includes and libraries")
|
||||
if (NOT Pleora_DIR)
|
||||
set (Pleora_DIR $ENV{PUREGEV_ROOT} CACHE PATH "Directory containing Pleora SDK includes and libraries")
|
||||
endif ()
|
||||
|
||||
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
|
||||
@ -21,19 +22,37 @@ else ()
|
||||
set(_LIB_SUFFIX "")
|
||||
endif ()
|
||||
|
||||
find_path (PLEORA_INCLUDE_DIR PvBase.h
|
||||
PATHS
|
||||
"${PLEORA_DIR}/Includes"
|
||||
set(_Pleora_PATHS PATHS
|
||||
"${Pleora_DIR}"
|
||||
"C:/Program Files/Pleora Technologies Inc/eBUS SDK/Includes"
|
||||
"C:/Program Files (x86)/Pleora Technologies Inc/eBUS SDK/Includes"
|
||||
DOC "Directory containing Pleora eBUS SDK headers")
|
||||
"C:/Program Files (x86)/Pleora Technologies Inc/eBUS SDK/Includes")
|
||||
|
||||
find_path (PLEORA_LIBRARIES_DIR PvBase${_LIB_SUFFIX}.lib
|
||||
PATHS
|
||||
"${PLEORA_DIR}/Libraries"
|
||||
"C:/Program Files/Pleora Technologies Inc/eBUS SDK/Libraries"
|
||||
"C:/Program Files (x86)/Pleora Technologies Inc/eBUS SDK/Libraries"
|
||||
DOC "Directory containing Pleora eBUS SDK libraries")
|
||||
find_path (Pleora_INCLUDE_DIR PvBase.h
|
||||
PATHS ${_Pleora_PATHS}
|
||||
PATH_SUFFIXES Includes)
|
||||
|
||||
find_path (Pleora_LIBRARY_DIR PvBase${_LIB_SUFFIX}.lib
|
||||
PATHS ${_Pleora_PATHS}
|
||||
PATH_SUFFIXES Libraries)
|
||||
|
||||
find_library (Pleora_LIBRARY_BASE PvBase${_LIB_SUFFIX} ${Pleora_LIBRARY_DIR})
|
||||
find_library (Pleora_LIBRARY_DEVICE PvDevice${_LIB_SUFFIX} ${Pleora_LIBRARY_DIR})
|
||||
|
||||
set (Pleora_LIBRARIES ${Pleora_LIBRARY_BASE} ${Pleora_LIBRARY_DEVICE})
|
||||
|
||||
file(STRINGS "${Pleora_INCLUDE_DIR}/PvVersion.h" _pleora_VERSION_CONTENTS REGEX "#define NVERSION_STRING")
|
||||
if ("${_pleora_VERSION_CONTENTS}" MATCHES "#define NVERSION_STRING[ \t]+\"([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.([0-9]+)+")
|
||||
set(Pleora_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
set(Pleora_VERSION_MINOR "${CMAKE_MATCH_2}")
|
||||
set(Pleora_VERSION_PATCH "${CMAKE_MATCH_3}")
|
||||
set(Pleora_VERSION_TWEAK "${CMAKE_MATCH_4}")
|
||||
set(Pleora_VERSION_COUNT 4)
|
||||
set(Pleora_VERSION_STRING "${Pleora_VERSION_MAJOR}.${Pleora_VERSION_MINOR}.${Pleora_VERSION_PATCH}.${Pleora_VERSION_TWEAK}")
|
||||
set(Pleora_VERSION ${Pleora_VERSION_STRING})
|
||||
message(STATUS "Found Pleora version: ${Pleora_VERSION_STRING}")
|
||||
endif ()
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (PLEORA DEFAULT_MSG PLEORA_INCLUDE_DIR PLEORA_LIBRARIES_DIR)
|
||||
find_package_handle_standard_args (Pleora
|
||||
REQUIRED_VARS Pleora_INCLUDE_DIR Pleora_LIBRARY_DIR Pleora_LIBRARIES
|
||||
VERSION_VAR Pleora_VERSION_STRING)
|
||||
@ -54,9 +54,9 @@ if (PHOENIX_FOUND)
|
||||
add_subdirectory(phoenix)
|
||||
endif (PHOENIX_FOUND)
|
||||
|
||||
if (PLEORA_FOUND)
|
||||
if (Pleora_FOUND)
|
||||
add_subdirectory(pleora)
|
||||
endif (PLEORA_FOUND)
|
||||
endif (Pleora_FOUND)
|
||||
|
||||
if (SAPERA_FOUND)
|
||||
add_subdirectory(sapera)
|
||||
|
||||
@ -2,21 +2,28 @@ add_definitions(-D_XKEYCHECK_H)
|
||||
|
||||
set (SOURCES
|
||||
gstpleora.cpp
|
||||
gstpleorasink.cpp
|
||||
gstpleorasrc.cpp
|
||||
streamingchannelsource.cpp)
|
||||
gstpleorasrc.cpp)
|
||||
|
||||
set (HEADERS
|
||||
gstpleorasrc.h)
|
||||
|
||||
if (Pleora_VERSION_MAJOR GREATER 5)
|
||||
set (SOURCES
|
||||
${SOURCES}
|
||||
gstpleorasink.cpp
|
||||
streamingchannelsource.cpp)
|
||||
set (HEADERS
|
||||
${HEADERS}
|
||||
gstpleorasink.h
|
||||
gstpleorasrc.h
|
||||
streamingchannelsource.h)
|
||||
endif ()
|
||||
|
||||
include_directories (AFTER
|
||||
${PLEORA_INCLUDE_DIR})
|
||||
${Pleora_INCLUDE_DIR})
|
||||
|
||||
set (libname libgstpleora)
|
||||
link_directories(${Pleora_LIBRARY_DIR})
|
||||
|
||||
link_directories(${PLEORA_LIBRARIES_DIR})
|
||||
set (libname libgstpleora${Pleora_VERSION_MAJOR})
|
||||
|
||||
add_library (${libname} MODULE
|
||||
${SOURCES}
|
||||
|
||||
@ -2,7 +2,11 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "PvVersion.h"
|
||||
#if VERSION_MAJOR >= 6
|
||||
#include "gstpleorasink.h"
|
||||
#endif
|
||||
|
||||
#include "gstpleorasrc.h"
|
||||
|
||||
#define GST_CAT_DEFAULT gst_pleora_debug
|
||||
@ -14,10 +18,13 @@ plugin_init (GstPlugin * plugin)
|
||||
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "pleora", 0,
|
||||
"debug category for pleora plugin");
|
||||
|
||||
#if VERSION_MAJOR >= 6
|
||||
/* eBUS 6 is needed for this sink element */
|
||||
if (!gst_element_register (plugin, "pleorasink", GST_RANK_NONE,
|
||||
gst_pleorasink_get_type ())) {
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!gst_element_register (plugin, "pleorasrc", GST_RANK_NONE,
|
||||
gst_pleorasrc_get_type ())) {
|
||||
@ -27,9 +34,11 @@ plugin_init (GstPlugin * plugin)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#define PLUGIN_NAME G_PASTE(pleora, VERSION_MAJOR)
|
||||
|
||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||
GST_VERSION_MINOR,
|
||||
pleora,
|
||||
"Pleora eBUS video sink/source",
|
||||
PLUGIN_NAME,
|
||||
"Pleora eBUS video elements",
|
||||
plugin_init, GST_PACKAGE_VERSION, GST_PACKAGE_LICENSE, GST_PACKAGE_NAME,
|
||||
GST_PACKAGE_ORIGIN)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user