diff --git a/configure.ac b/configure.ac index 9cf3de2fce..ec821e224c 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 5223bc7f73..6d18a9993d 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 #include #include diff --git a/ext/opencv/MotionCells.h b/ext/opencv/MotionCells.h index c5d4b17a5c..68a2fec575 100644 --- a/ext/opencv/MotionCells.h +++ b/ext/opencv/MotionCells.h @@ -46,10 +46,11 @@ #define MOTIONCELLS_H_ #include // includes OpenCV definitions -#ifndef __OPENCV_OLD_CV_H__ +#ifdef HAVE_HIGHGUI_H #include // includes highGUI definitions -#else -#include // includes highGUI definitions +#endif +#ifdef HAVE_OPENCV2_HIGHGUI_HIGHGUI_C_H +#include // includes highGUI definitions #endif #include #include diff --git a/ext/opencv/gstopencvutils.c b/ext/opencv/gstopencvutils.c index dc42f90d58..8c72257cc6 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 7e55ac6cf6..8d99f982e4 100644 --- a/ext/opencv/gsttemplatematch.h +++ b/ext/opencv/gsttemplatematch.h @@ -48,10 +48,11 @@ #include #include -#ifndef __OPENCV_OLD_CV_H__ +#ifdef HAVE_HIGHGUI_H #include // includes highGUI definitions -#else -#include // includes highGUI definitions +#endif +#ifdef HAVE_OPENCV2_HIGHGUI_HIGHGUI_C_H +#include // includes highGUI definitions #endif G_BEGIN_DECLS diff --git a/ext/opencv/motioncells_wrapper.cpp b/ext/opencv/motioncells_wrapper.cpp index d509686774..f55802bb4d 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 #include #include "motioncells_wrapper.h"