Fix build issues related to opencv2

This commit is contained in:
Bradlee Speice 2012-07-19 18:13:36 -04:00
parent 86332f894b
commit 84383e2053
2 changed files with 11 additions and 8 deletions

View File

@ -30,19 +30,22 @@ AC_PATH_X
#Configure OpenCV - version 2+ breaks a lot of things
PKG_CHECK_MODULES([OpenCV], [opencv >= 2.0.0], [use_opencv2=true], [use_opencv1=true])
#Let doxygen know where our headers are at
AC_SUBST(CV_VERSION, "opencv2")
AC_SUBST_FILE([cv_headers])
cv_headers=$srcdir/include/opencv2_includes
if test "$use_opencv1" != ""; then
if test "$use_opencv2" == "true"; then
#Let doxygen know where our headers are at
AC_SUBST(CV_VERSION, "opencv2")
cv_headers=$srcdir/include/opencv2_includes
AC_SUBST(CV_CFLAGS, [`pkg-config --cflags opencv`])
AC_SUBST(CV_LIBS, ["-lopencv_core -lopencv_imgproc -lopencv_highgui"])
else
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])
#Update doxygen on where our headers are at
AC_SUBST(CV_VERSION, "opencv1")
cv_headers=$srcdir/include/opencv1_includes
AC_SUBST(CV_CFLAGS, [`pkg-config --cflags opencv`])
AC_SUBST(CV_LIBS, [`pkg-config --libs opencv`])
fi
AC_SUBST(CV_CFLAGS, [`pkg-config --cflags opencv`])
AC_SUBST(CV_LIBS, [`pkg-config --libs opencv`])
PKG_CHECK_MODULES([X11], [x11 >= 1.0.3])
AC_SUBST(X11_CFLAGS, [`pkg-config --cflags x11`])

View File

@ -1,7 +1,7 @@
if BUILD_EXAMPLES
#Need to include the -Ilibcvautomation so that libcvautomation.h can find everything that it needs
AM_LDFLAGS = -L../libcvautomation/.libs -lcvautomation `pkg-config --libs x11` `pkg-config --libs opencv` `pkg-config --libs xtst`
AM_CFLAGS = -Wall -Werror -O2 -I$(top_srcdir)/include
AM_LDFLAGS = -L../libcvautomation/.libs -lcvautomation @X11_LIBS@ @XTEST_LIBS@ @CV_LIBS@
AM_CFLAGS = -Wall -Werror -O2 -I$(top_srcdir)/include @X11_CFLAGS@ @XTEST_CFLAGS@ @CV_CFLAGS@
#Build only if we're building the examples
bin_PROGRAMS = cva-match cva-input