Fix up the brutish hack into something that looks much better

This commit is contained in:
Bradlee Speice 2012-07-19 17:32:59 -04:00
parent c4c700fcda
commit 86332f894b
4 changed files with 13 additions and 15 deletions

View File

@ -32,21 +32,14 @@ AC_PATH_X
PKG_CHECK_MODULES([OpenCV], [opencv >= 2.0.0], [use_opencv2=true], [use_opencv1=true]) PKG_CHECK_MODULES([OpenCV], [opencv >= 2.0.0], [use_opencv2=true], [use_opencv1=true])
#Let doxygen know where our headers are at #Let doxygen know where our headers are at
AC_SUBST(CV_VERSION, "opencv2") AC_SUBST(CV_VERSION, "opencv2")
AC_SUBST(CV_HEADERS_1, ["/* OpenCV2 includes - some filenames are different"]) AC_SUBST_FILE([cv_headers])
AC_SUBST(CV_HEADERS_2, [" * from the OpenCV1 counterparts */"]) cv_headers=$srcdir/include/opencv2_includes
AC_SUBST(CV_HEADERS_3, ["include <opencv2/core/core_c.h>"])
AC_SUBST(CV_HEADERS_4, ["include <opencv2/highgui/highgui_c.h>"])
AC_SUBST(CV_HEADERS_5, ["include <opencv2/imgproc/imgproc_c.h>"])
if test "$use_opencv1" != ""; then if test "$use_opencv1" != ""; then
echo "could not find OpenCV version 2.0.0 or higher, checking for 1.0.0 or higher..." echo "could not find OpenCV version 2.0.0 or higher, checking for 1.0.0 or higher..."
PKG_CHECK_MODULES([OpenCV], [opencv >= 1.0.0]) PKG_CHECK_MODULES([OpenCV], [opencv >= 1.0.0])
#Update doxygen on where our headers are at #Update doxygen on where our headers are at
AC_SUBST(CV_VERSION, "opencv1") AC_SUBST(CV_VERSION, "opencv1")
AC_SUBST(CV_HEADERS_1, ["/* OpenCV includes */"]) cv_headers=$srcdir/include/opencv1_includes
AC_SUBST(CV_HEADERS_2, [" " ])
AC_SUBST(CV_HEADERS_3, ["include <opencv/cv.h>"])
AC_SUBST(CV_HEADERS_4, ["include <opencv/highgui.h>"])
AC_SUBST(CV_HEADERS_5, ["define NEVER_USED"])
fi fi
AC_SUBST(CV_CFLAGS, [`pkg-config --cflags opencv`]) AC_SUBST(CV_CFLAGS, [`pkg-config --cflags opencv`])
AC_SUBST(CV_LIBS, [`pkg-config --libs opencv`]) AC_SUBST(CV_LIBS, [`pkg-config --libs opencv`])

View File

@ -25,11 +25,7 @@
#include <string.h> #include <string.h>
/* Autoconf logic to select the correct OpenCV version */ /* Autoconf logic to select the correct OpenCV version */
@CV_HEADERS_1@ @cv_headers@
@CV_HEADERS_2@
#@CV_HEADERS_3@
#@CV_HEADERS_4@
#@CV_HEADERS_5@
/* X11 includes */ /* X11 includes */
#include <X11/Xlib.h> #include <X11/Xlib.h>

4
include/opencv1_includes Normal file
View File

@ -0,0 +1,4 @@
/* OpenCV includes */
#include <opencv/cv.h>
#include <opencv/highgui.h>

5
include/opencv2_includes Normal file
View File

@ -0,0 +1,5 @@
/* OpenCV2 includes - some filenames are different
* from the OpenCV1 counterparts */
#include <opencv2/core/core_c.h>
#include <opencv2/highgui/highgui_c.h>
#include <opencv2/imgproc/imgproc_c.h>