aboutsummaryrefslogtreecommitdiff
path: root/graphics/opencv
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2013-09-12 13:00:12 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2013-09-12 13:00:12 +0000
commit18e111e32f4c3e15178be68a9104753a900c0cca (patch)
treee1eb47eb6d033d2cca8636cc5e033f7c088e2b78 /graphics/opencv
parent6e8c9bd6d54175de3c0a19096d7129178d8efa51 (diff)
downloadports-18e111e32f4c3e15178be68a9104753a900c0cca.tar.gz
ports-18e111e32f4c3e15178be68a9104753a900c0cca.zip
Fix build of opencv with libc++
share the CXXFLAGS between opencv-core and opencv
Notes
Notes: svn path=/head/; revision=327060
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();