1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
commit 638527ffaa35ffb0bf88a32910b809df09432406
Author: Toyohisa Kameyama <kameyama@riken.jp>
Date: Mon May 18 11:58:00 2020 +0900
Makefile bug fix for opencv4.
diff --git a/Makefile b/Makefile
index 51930c782..7f5d4da39 100644
--- a/Makefile
+++ b/Makefile
@@ -165,7 +165,23 @@ endif
ifeq ($(USE_OPENCV), 1)
CFLAGS += -DMXNET_USE_OPENCV=1
ifneq ($(filter-out NONE, $(USE_OPENCV_INC_PATH)),)
- CFLAGS += -I$(USE_OPENCV_INC_PATH)/include
+ ifneq ($(wildcard $(USE_OPENCV_INC_PATH)/include/opencv4/opencv2/opencv*),)
+ opencv_inc = -I$(USE_OPENCV_INC_PATH)/include/opencv4
+ endif
+ ifneq ($(wildcard $(USE_OPENCV_INC_PATH)/include/opencv2/opencv*),)
+ opencv_inc = -I$(USE_OPENCV_INC_PATH)/include
+ endif
+ ifneq ($(wildcard $(USE_OPENCV_INC_PATH)/opencv4/opencv2/opencv*),)
+ opencv_inc = -I$(USE_OPENCV_INC_PATH)/opencv4
+ endif
+ ifneq ($(wildcard $(USE_OPENCV_INC_PATH)/opencv2/opencv*),)
+ opencv_inc = -I$(USE_OPENCV_INC_PATH)
+ endif
+ ifneq ($(filter-out NONE, $(opencv_inc)),)
+ CFLAGS += $(opencv_inc)
+ else
+$(error Cannot determine OpenCV include path)
+ endif
ifeq ($(filter-out NONE, $(USE_OPENCV_LIB_PATH)),)
$(error Please add the path of OpenCV shared library path into `USE_OPENCV_LIB_PATH`, when `USE_OPENCV_INC_PATH` is not NONE)
endif
|