Add opencv_imgcodecs to library path in Makefile
authorAndreas Løve Selvik <andreas.l.selvik@gmail.com>
Tue, 13 Oct 2015 14:32:52 +0000 (16:32 +0200)
committerAndreas Løve Selvik <andreas.l.selvik@gmail.com>
Thu, 22 Oct 2015 20:24:29 +0000 (22:24 +0200)
Project does not compile without opencv_imgcodecs in the library path if
you're using OpenCV 3.

This introduces a OPENCV_VERSION flag in Makefile.config that includes
the library if set to 3.  (Trying to include it with OpenCV 2 also
breaks the build)

Makefile
Makefile.config.example

index 5fb6394..43cb15f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -184,7 +184,12 @@ ifeq ($(USE_LMDB), 1)
        LIBRARIES += lmdb
 endif
 ifeq ($(USE_OPENCV), 1)
-       LIBRARIES += opencv_core opencv_highgui opencv_imgproc
+       LIBRARIES += opencv_core opencv_highgui opencv_imgproc 
+
+       ifeq ($(OPENCV_VERSION), 3)
+               LIBRARIES += opencv_imgcodecs
+       endif
+               
 endif
 PYTHON_LIBRARIES := boost_python python2.7
 WARNINGS := -Wall -Wno-sign-compare
index a20bad2..8e2c4fb 100644 (file)
@@ -12,6 +12,9 @@
 # USE_LMDB := 0
 # USE_OPENCV := 0
 
+# Uncomment if you're using OpenCV 3
+# OPENCV_VERSION := 3
+
 # To customize your choice of compiler, uncomment and set the following.
 # N.B. the default for Linux is g++ and the default for OSX is clang++
 # CUSTOM_CXX := g++