diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2012-03-17 12:47:52 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2012-03-17 14:53:50 +0000 |
commit | 692bf9ba633c909efd313259598202d30ce0bb08 (patch) | |
tree | 4acda54eebaf9f914607e6239bd58abf95fe655d | |
parent | 486ddd38cf872099048f05b5f7739d6205e8d979 (diff) | |
download | gstreamer-plugins-bad-692bf9ba633c909efd313259598202d30ce0bb08.tar.gz |
opencv: fix configure check and build with opencv 2.1
AC_CHECK_HEADERS() calls action-if-not-found also if just one of
the headers checked for is missing, which is not what we wanted.
Also, check for highgui_c.h instead of highgui.hpp.
https://bugzilla.gnome.org/show_bug.cgi?id=672226
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | ext/opencv/MotionCells.cpp | 7 | ||||
-rw-r--r-- | ext/opencv/MotionCells.h | 7 | ||||
-rw-r--r-- | ext/opencv/gstopencvutils.c | 4 | ||||
-rw-r--r-- | ext/opencv/gsttemplatematch.h | 7 | ||||
-rw-r--r-- | ext/opencv/motioncells_wrapper.cpp | 7 |
6 files changed, 32 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac index 9cf3de2fc..ec821e224 100644 --- a/configure.ac +++ b/configure.ac @@ -1432,14 +1432,15 @@ AG_GST_CHECK_FEATURE(OPENCV, [opencv plugins], opencv, [ AC_LANG_CPLUSPLUS OLD_CPPFLAGS=$CPPFLAGS CPPFLAGS=$OPENCV_CFLAGS - AC_CHECK_HEADERS(highgui.h opencv2/highgui/highgui.hpp, HAVE_HIGHGUI="yes", HAVE_HIGHGUI="no") + AC_CHECK_HEADERS([highgui.h opencv2/highgui/highgui_c.h]) CPPFLAGS=$OLD_CPPFLAGS AC_LANG_C - if test "x$HAVE_HIGHGUI" = "xno"; then - AC_MSG_RESULT(highgui.h could not be found.) - HAVE_OPENCV="no" - else + + 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]) + HAVE_OPENCV="no" fi ], [ HAVE_OPENCV="no" diff --git a/ext/opencv/MotionCells.cpp b/ext/opencv/MotionCells.cpp index 5223bc7f7..6d18a9993 100644 --- a/ext/opencv/MotionCells.cpp +++ b/ext/opencv/MotionCells.cpp @@ -42,6 +42,13 @@ * Boston, MA 02111-1307, USA. */ +/* This breaks the build for reasons that aren't entirely clear to me yet */ +#if 0 +//#ifdef HAVE_CONFIG_H +//#include "config.h" +//#endif +#endif + #include <cstdlib> #include <errno.h> #include <math.h> diff --git a/ext/opencv/MotionCells.h b/ext/opencv/MotionCells.h index c5d4b17a5..68a2fec57 100644 --- a/ext/opencv/MotionCells.h +++ b/ext/opencv/MotionCells.h @@ -46,10 +46,11 @@ #define MOTIONCELLS_H_ #include <cv.h> // includes OpenCV definitions -#ifndef __OPENCV_OLD_CV_H__ +#ifdef HAVE_HIGHGUI_H #include <highgui.h> // includes highGUI definitions -#else -#include <opencv2/highgui/highgui.hpp> // includes highGUI definitions +#endif +#ifdef HAVE_OPENCV2_HIGHGUI_HIGHGUI_C_H +#include <opencv2/highgui/highgui_c.h> // includes highGUI definitions #endif #include <iostream> #include <fstream> diff --git a/ext/opencv/gstopencvutils.c b/ext/opencv/gstopencvutils.c index dc42f90d5..8c72257cc 100644 --- a/ext/opencv/gstopencvutils.c +++ b/ext/opencv/gstopencvutils.c @@ -19,6 +19,10 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "gstopencvutils.h" static gboolean diff --git a/ext/opencv/gsttemplatematch.h b/ext/opencv/gsttemplatematch.h index 7e55ac6cf..8d99f982e 100644 --- a/ext/opencv/gsttemplatematch.h +++ b/ext/opencv/gsttemplatematch.h @@ -48,10 +48,11 @@ #include <gst/gst.h> #include <cv.h> -#ifndef __OPENCV_OLD_CV_H__ +#ifdef HAVE_HIGHGUI_H #include <highgui.h> // includes highGUI definitions -#else -#include <opencv2/highgui/highgui.hpp> // includes highGUI definitions +#endif +#ifdef HAVE_OPENCV2_HIGHGUI_HIGHGUI_C_H +#include <opencv2/highgui/highgui_c.h> // includes highGUI definitions #endif G_BEGIN_DECLS diff --git a/ext/opencv/motioncells_wrapper.cpp b/ext/opencv/motioncells_wrapper.cpp index d50968677..f55802bb4 100644 --- a/ext/opencv/motioncells_wrapper.cpp +++ b/ext/opencv/motioncells_wrapper.cpp @@ -42,6 +42,13 @@ * Boston, MA 02111-1307, USA. */ +/* This breaks the build for reasons that aren't entirely clear to me yet */ +#if 0 +//#ifdef HAVE_CONFIG_H +//#include "config.h" +//#endif +#endif + #include <stdio.h> #include <limits.h> #include "motioncells_wrapper.h" |