opencv: Change configure test to check for OpenCV2 headers

* Checks for opencv2 headers only, not for legacy opencv1 headers
* Checks for every opencv2 header that the implementation needs,
  not just highgui_c.h

https://bugzilla.gnome.org/show_bug.cgi?id=725163
This commit is contained in:
Руслан Ижбулатов 2015-04-12 00:56:48 +00:00 committed by Sebastian Dröge
parent a02a948a5d
commit 64080e632d

View file

@ -2447,15 +2447,26 @@ AG_GST_CHECK_FEATURE(OPENCV, [opencv plugins], opencv, [
AC_LANG([C++])
OLD_CPPFLAGS=$CPPFLAGS
CPPFLAGS=$OPENCV_CFLAGS
AC_CHECK_HEADERS([highgui.h opencv2/highgui/highgui_c.h])
something_not_found=no
AC_CHECK_HEADERS([opencv2/contrib/contrib.hpp \
opencv2/core/core_c.h \
opencv2/core/types_c.h \
opencv2/core/version.hpp \
opencv2/highgui/highgui_c.h \
opencv2/imgproc/imgproc.hpp \
opencv2/imgproc/imgproc_c.h \
opencv2/legacy/compat.hpp \
opencv2/legacy/legacy.hpp \
opencv2/objdetect/objdetect.hpp \
opencv2/video/background_segm.hpp], [], [something_not_found=yes])
CPPFLAGS=$OLD_CPPFLAGS
AC_LANG([C])
if test $ac_cv_header_highgui_h = "yes" -o $ac_cv_header_opencv2_highgui_highgui_c_h = "yes" ; then
HAVE_OPENCV="yes"
else
AC_MSG_RESULT([neither highgui.h nor opencv2/highgui/highgui_c.h could not be found])
if test $something_not_found = "yes"; then
AC_MSG_RESULT([not all opencv2 headers were found])
HAVE_OPENCV="no"
else
HAVE_OPENCV="yes"
fi
], [
HAVE_OPENCV="no"