aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/opencv
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2013-09-12 21:00:12 +0800
committerbapt <bapt@FreeBSD.org>2013-09-12 21:00:12 +0800
commitc832f73a0f3907245928436b27bc7410d1d4b3e1 (patch)
treee1eb47eb6d033d2cca8636cc5e033f7c088e2b78 /graphics/opencv
parent12732744bdb12487c2294783f3971336b434e49c (diff)
downloadfreebsd-ports-gnome-c832f73a0f3907245928436b27bc7410d1d4b3e1.tar.gz
freebsd-ports-gnome-c832f73a0f3907245928436b27bc7410d1d4b3e1.tar.zst
freebsd-ports-gnome-c832f73a0f3907245928436b27bc7410d1d4b3e1.zip
Fix build of opencv with libc++
share the CXXFLAGS between opencv-core and opencv
Diffstat (limited to 'graphics/opencv')
-rw-r--r--graphics/opencv/Makefile6
-rw-r--r--graphics/opencv/files/patch-samples_cpp_bagofwords_classification.cpp11
2 files changed, 17 insertions, 0 deletions
diff --git a/graphics/opencv/Makefile b/graphics/opencv/Makefile
index f5e7ecc192d2..7d6203567997 100644
--- a/graphics/opencv/Makefile
+++ b/graphics/opencv/Makefile
@@ -28,6 +28,12 @@ NOT_FOR_ARCHS_REASON_sparc64= does not compile on sparc64
DATADIR= ${PREFIX}/share/OpenCV
PLIST_SUB+= VERSION=${DISTVERSION}
+_COMPVERSION!= ${CC} --version
+.if ${_COMPVERSION:Mclang}
+USE_CXXSTD= gnu++11
+CXXFLAGS+= -Wno-error -Wno-c++11-narrowing
+.endif
+
.if !defined(_BUILDING_OPENCV_CORE) && !defined(_BUILDING_OPENCV_PYTHON)
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-opencv
LIB_DEPENDS+= opencv_core.2:${PORTSDIR}/graphics/opencv-core
diff --git a/graphics/opencv/files/patch-samples_cpp_bagofwords_classification.cpp b/graphics/opencv/files/patch-samples_cpp_bagofwords_classification.cpp
new file mode 100644
index 000000000000..45e93d010363
--- /dev/null
+++ b/graphics/opencv/files/patch-samples_cpp_bagofwords_classification.cpp
@@ -0,0 +1,11 @@
+--- samples/cpp/bagofwords_classification.cpp.orig 2011-09-12 20:20:43.000000000 +0200
++++ samples/cpp/bagofwords_classification.cpp 2013-09-12 14:57:38.068066669 +0200
+@@ -1814,7 +1814,7 @@
+ void VocData::readFileToString(const string filename, string& file_contents)
+ {
+ std::ifstream ifs(filename.c_str());
+- if (ifs == false) CV_Error(CV_StsError,"could not open text file");
++ if (!ifs.is_open()) CV_Error(CV_StsError,"could not open text file");
+
+ stringstream oss;
+ oss << ifs.rdbuf();