Skip to content

Commit

Permalink
Zaber: Copy ZML libs during Linux install
Browse files Browse the repository at this point in the history
For now this is the simplest way to make Zaber work when built under
Linux. The copy only happens if Zaber is being built.

Also restore the setting of rpath to $ORIGIN in the Zaber device
adapter.
  • Loading branch information
marktsuchida committed Sep 5, 2023
1 parent e851bf7 commit 6f0ca5e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions DeviceAdapters/Zaber/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ libmmgr_dal_Zaber_la_SOURCES = \
libmmgr_dal_Zaber_la_LIBADD = $(MMDEVAPI_LIBADD) $(ZML_LIBS)
libmmgr_dal_Zaber_la_LDFLAGS = $(MMDEVAPI_LDFLAGS) $(ZML_LDFLAGS)

dist_deviceadapter_DATA = $(ZML_LIBS_TO_COPY)

EXTRA_DIST = Zaber.vcxproj Zaber.vcxproj.filters license.txt
13 changes: 11 additions & 2 deletions DeviceAdapters/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -404,16 +404,25 @@ if test -f "$zml_header_to_check"; then
ZML_LIBS="-lzml"
case $host in
*linux*)
ZML_LDFLAGS="-L${thirdpartypublic}/Zaber/zaber-motion/linux-amd64/lib" ;;
# Linux builds by users should install ZML libs
zml_linux_libdir="${thirdpartypublic}/Zaber/zaber-motion/linux-amd64/lib"
ZML_LDFLAGS="-L${zml_linux_libdir} -Wl,-rpath,"'\$$ORIGIN'
ZML_LIBS_TO_COPY="${zml_linux_libdir}/libzml.so.3.4 ${zml_linux_libdir}/libzaber-motion-lib-linux-amd64.so.3.4.3"
;;

*apple-darwin*)
ZML_LDFLAGS="-L${thirdpartypublic}/Zaber/zaber-motion/darwin/lib" ;;
# macOS build for packaging does not ship ZML
ZML_LDFLAGS="-L${thirdpartypublic}/Zaber/zaber-motion/darwin/lib"
ZML_LIBS_TO_COPY=""
;;
esac
else
AC_MSG_RESULT([not found])
fi
AC_SUBST(ZML_CPPFLAGS)
AC_SUBST(ZML_LIBS)
AC_SUBST(ZML_LDFLAGS)
AC_SUBST(ZML_LIBS_TO_COPY)


# Only build ... when the code is there
Expand Down

0 comments on commit 6f0ca5e

Please sign in to comment.