opencv: Fix OpenCV data path check to work with cross compilation

https://bugzilla.gnome.org/show_bug.cgi?id=753651
This commit is contained in:
Carlos Rafael Giani 2015-08-20 14:09:37 +02:00 committed by Luis de Bethencourt
parent 09b4f050e0
commit 0cc2156572

View file

@ -33,6 +33,9 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
[AM_DEFAULT_VERBOSITY=1 [AM_DEFAULT_VERBOSITY=1
AC_SUBST(AM_DEFAULT_VERBOSITY)]) AC_SUBST(AM_DEFAULT_VERBOSITY)])
dnl PKG_CONFIG_SYSROOT_DIR is a valid environment variable
m4_pattern_allow(PKG_CONFIG_SYSROOT_DIR)
dnl our libraries and install dirs use GST_API_VERSION in the filename dnl our libraries and install dirs use GST_API_VERSION in the filename
dnl to allow side-by-side installation of different API versions dnl to allow side-by-side installation of different API versions
GST_API_VERSION=1.0 GST_API_VERSION=1.0
@ -2486,9 +2489,15 @@ AG_GST_CHECK_FEATURE(OPENCV, [opencv plugins], opencv, [
AC_SUBST(OPENCV_PREFIX) AC_SUBST(OPENCV_PREFIX)
AC_SUBST(OPENCV_CFLAGS) AC_SUBST(OPENCV_CFLAGS)
AC_SUBST(OPENCV_LIBS) AC_SUBST(OPENCV_LIBS)
AC_CHECK_FILE([$OPENCV_PREFIX/share/opencv/], dnl the OpenCV prefix is used at runtime for some object properties, and also
[AC_DEFINE_UNQUOTED(OPENCV_PATH_NAME, ["opencv"], [OpenCV path name])], dnl used here to detect which directory is the correct one. For the second
[AC_DEFINE_UNQUOTED(OPENCV_PATH_NAME, ["OpenCV"], [OpenCV path name])]) dnl case, make sure the right sysroot is used, ensuring correct behavior
dnl during cross compilation.
if test -d "$PKG_CONFIG_SYSROOT_DIR/$OPENCV_PREFIX/share/opencv/"; then
AC_DEFINE_UNQUOTED(OPENCV_PATH_NAME, ["opencv"], [OpenCV path name])
else
AC_DEFINE_UNQUOTED(OPENCV_PATH_NAME, ["OpenCV"], [OpenCV path name])
fi
]) ])
dnl *** OpenEXR *** dnl *** OpenEXR ***