From 8eb1882c5da7c88c74e165655dfce706e94ccf39 Mon Sep 17 00:00:00 2001 From: "Mark A. Tsuchida" Date: Thu, 26 Oct 2023 18:50:15 -0500 Subject: [PATCH] AlliedVisionCamera: Set up with ./configure Also fix a bug in Autoconf function MM_LIB_IFELSE() (allow MM_LIB_SIMPLE() to work even if no function to test is given). --- DeviceAdapters/AlliedVisionCamera/Makefile.am | 18 +++++++++++++----- DeviceAdapters/Makefile.am | 5 ++++- DeviceAdapters/configure.ac | 19 +++++++++++++++++++ m4/mm_lib_ifelse.m4 | 2 +- m4/mm_libs.m4 | 11 +++++++++++ 5 files changed, 48 insertions(+), 7 deletions(-) diff --git a/DeviceAdapters/AlliedVisionCamera/Makefile.am b/DeviceAdapters/AlliedVisionCamera/Makefile.am index 1f4fa159a..7719d678e 100644 --- a/DeviceAdapters/AlliedVisionCamera/Makefile.am +++ b/DeviceAdapters/AlliedVisionCamera/Makefile.am @@ -1,9 +1,17 @@ - AUTOMAKE_OPTIONS = subdir-objects -AM_CXXFLAGS = $(MMDEVAPI_CXXFLAGS) -I$(VIMBA_X_HOME)/api/include +AM_CXXFLAGS = $(MMDEVAPI_CXXFLAGS) $(VIMBA_X_CPPFLAGS) deviceadapter_LTLIBRARIES = libmmgr_dal_AlliedVisionCamera.la -libmmgr_dal_AlliedVisionCamera_la_SOURCES = AlliedVisionHub.h AlliedVisionHub.cpp AlliedVisionDeviceBase.h AlliedVisionDeviceBase.cpp AlliedVisionCamera.h AlliedVisionCamera.cpp Loader/Constants.h Loader/LibLoader.h Loader/LibLoader.cpp $(VIMBA_X_HOME)/api/include/VmbC/VmbC.h $(VIMBA_X_HOME)/api/include/VmbC/VmbCommonTypes.h $(VIMBA_X_HOME)/api/include/VmbC/VmbConstants.h $(VIMBA_X_HOME)/api/include/VmbC/VmbCTypeDefinitions.h $(VIMBA_X_HOME)/api/include/VmbImageTransform/VmbTransform.h $(VIMBA_X_HOME)/api/include/VmbImageTransform/VmbTransformTypes.h + +libmmgr_dal_AlliedVisionCamera_la_SOURCES = \ + AlliedVisionCamera.cpp \ + AlliedVisionCamera.h \ + AlliedVisionDeviceBase.cpp \ + AlliedVisionDeviceBase.h \ + AlliedVisionHub.cpp \ + AlliedVisionHub.h \ + Loader/Constants.h \ + Loader/LibLoader.cpp \ + Loader/LibLoader.h + libmmgr_dal_AlliedVisionCamera_la_LIBADD = $(MMDEVAPI_LIBADD) libmmgr_dal_AlliedVisionCamera_la_LDFLAGS = $(MMDEVAPI_LDFLAGS) - -EXTRA_DIST = AlliedVisionCamera.vcproj AlliedVisionCamera.vcproj.filters AlliedVisionCamera.vcproj.user diff --git a/DeviceAdapters/Makefile.am b/DeviceAdapters/Makefile.am index 454243648..ec6b8891a 100644 --- a/DeviceAdapters/Makefile.am +++ b/DeviceAdapters/Makefile.am @@ -1,6 +1,9 @@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I ../m4 +if BUILD_ALLIED_VISION_CAMERA + ALLIED_VISION_CAMERA = AlliedVisionCamera +endif if BUILD_ANDOR ANDOR = Andor endif @@ -71,6 +74,7 @@ endif # Please keep these ASCII-lexically sorted (pass through sort(1)). SUBDIRS = \ + $(ALLIED_VISION_CAMERA) \ $(ANDOR) \ $(ANDORLASERCOMBINER) \ $(ANDORSDK3) \ @@ -95,7 +99,6 @@ SUBDIRS = \ $(V4L) \ $(ZABER) \ AAAOTF \ - AlliedVisionCamera \ AOTF \ ASIFW1000 \ ASIStage \ diff --git a/DeviceAdapters/configure.ac b/DeviceAdapters/configure.ac index b68f9d88c..7424deba3 100644 --- a/DeviceAdapters/configure.ac +++ b/DeviceAdapters/configure.ac @@ -394,6 +394,22 @@ AS_IF([test "x$want_opencv" != xno], AM_CONDITIONAL([BUILD_OPENCV], [test "x$use_opencv" = xyes]) +# Vimba X (Allied Vision) SDK +MM_ARG_WITH_OPTIONAL_LIB([Vimba X], [vimba-x], [VIMBA_X]) +AS_IF([test "x$want_vimba_x" != xno], +[ + MM_LIB_VIMBA_X([$VIMBA_X_PREFIX], + [use_vimba_x=yes], + [ + use_vimba_x=no + AS_IF([test "x$want_vimba_x" = xyes], + [MM_MSG_OPTIONAL_LIB_FAILURE([Vimba X], [vimba-x])]) + ]) +], +[use_vimba_x=no]) + +AM_CONDITIONAL([BUILD_ALLIED_VISION_CAMERA], [test "x$use_vimba_x" = xyes]) + # Zaber Motion Library (hack: only support 3rdpartypublic copy currently) AC_MSG_CHECKING([for Zaber Motion Library in 3rdpartypublic]) zml_header_to_check="${thirdpartypublic}/Zaber/zaber-motion/include/zaber/motion/library.h" @@ -677,4 +693,7 @@ echo "m4_text_wrap([$use_libusb_0_1], echo "m4_text_wrap([$use_opencv], [ ], [ Build with OpenCV: ])" +echo "m4_text_wrap([$use_vimba_x], + [ ], + [ Build with Vimba X: ])" echo "" diff --git a/m4/mm_lib_ifelse.m4 b/m4/mm_lib_ifelse.m4 index 171f2db00..74b8ec6a3 100644 --- a/m4/mm_lib_ifelse.m4 +++ b/m4/mm_lib_ifelse.m4 @@ -64,7 +64,7 @@ AC_DEFUN([MM_LIB_IFELSE], [ ]) ], [ - mm_lib_ifelse_have_$1=no + mm_lib_ifelse_have_$1=yes ]) ]) diff --git a/m4/mm_libs.m4 b/m4/mm_libs.m4 index 4f6296471..603a2aa14 100644 --- a/m4/mm_libs.m4 +++ b/m4/mm_libs.m4 @@ -105,3 +105,14 @@ AC_DEFUN([MM_LIB_USB_0_1], [ [$1], [-lusb], [usb.h], [usb_init], [$2], [$3]) ]) + + +# Check for Allied Vision Vimba X SDK +# +# MM_LIB_VIMBA_X([Vimba X api prefix], [action-if-found], [action-if-not-found]) +# +# Defines variable VIMBA_X_CPPFLAGS. +# +AC_DEFUN([MM_LIB_VIMBA_X], [ + MM_LIB_SIMPLE([VIMBA_X], [Vimba X], [$1], [], [VmbC/VmbC.h], [], [$2], [$3]) +])