Skip to content

Commit 458ebb1

Browse files
committed
Fixing OpenCV compilation + C++17 selection
1 parent f91a398 commit 458ebb1

File tree

5 files changed

+19
-32
lines changed

5 files changed

+19
-32
lines changed

modules/Makefile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
1-
SYSTEMC?=$(HOME)/systemc-2.3.3
1+
SYSTEMC?=$(SYSTEMC_HOME)
22
TARGET?=test
33

44
# Compiler
55
CC=g++
66
CFLAGS=-Wall -I. -O3 -g -Wextra -Wunused-function
77

8+
ifdef USE_CPP17
9+
CFLAGS+=-std=c++17
10+
endif
11+
812
# Target
913
LD=g++
1014
LFLAGS=-Wall -I. -lm -g
1115
LIBS=-lsystemc -lm
1216

17+
ifdef INCLUDE_OPENCV
18+
# Target
19+
LIBS+=-lopencv_imgcodecs -lopencv_core -lopencv_highgui -lopencv_imgproc
20+
21+
# Source directories
22+
INCDIR+=-I$(OPENCV_H_DIR)
23+
LIBDIR+=-L$(OPENCV_SO_DIR)
24+
else
25+
ifdef INCLUDE_OPENCV_PKG
26+
CFLAGS += $(shell pkg-config --cflags opencv4)
27+
LFLAGS += $(shell pkg-config --libs opencv4)
28+
endif # INCLUDE_OPENCV_PKG
29+
endif # INCLUDE_OPENCV
30+
1331
# Source directories
1432
SRCDIR=src
1533
OBJDIR=obj

modules/edge-detector/Makefile

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
# Include common Makefile
22
include ../Makefile
33

4-
ifdef INCLUDE_OPENCV
5-
# Target
6-
LIBS+=-lopencv_imgcodecs -lopencv_core -lopencv_highgui -lopencv_imgproc
7-
8-
# Source directories
9-
INCDIR+=-I/usr/local/include/opencv4
10-
LIBDIR+=-L/usr/local/lib
11-
else
12-
CFLAGS += $(shell pkg-config --cflags opencv4)
13-
LFLAGS += $(shell pkg-config --libs opencv4)
14-
endif # INCLUDE_OPENCV
15-
164
# Defining preprocessor directive for debug
175
ifdef IPS_DEBUG_EN
186
CFLAGS += -DIPS_DEBUG_EN

modules/filter/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Include common Makefile
22
include ../Makefile
33

4-
# Include OpenCV for compilation
5-
CFLAGS += $(shell pkg-config --cflags opencv4)
6-
LFLAGS += $(shell pkg-config --libs opencv4)
7-
84
# Defining preprocessor directive for debug
95
ifdef IPS_DEBUG_EN
106
CFLAGS += -DIPS_DEBUG_EN

modules/rgb2gray/Makefile

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
# Include common Makefile
22
include ../Makefile
33

4-
CFLAGS+=-std=c++17
5-
6-
ifdef INCLUDE_OPENCV
7-
# Target
8-
LIBS+=-lopencv_imgcodecs -lopencv_core -lopencv_highgui -lopencv_imgproc
9-
10-
# Source directories
11-
INCDIR+=-I$(OPENCV_H_DIR)
12-
LIBDIR+=-L$(OPENCV_SO_DIR)
13-
else
14-
CFLAGS += $(shell pkg-config --cflags opencv4)
15-
LFLAGS += $(shell pkg-config --libs opencv4)
16-
endif # INCLUDE_OPENCV
17-
184
# Defining preprocessor directive for debug
195
ifdef IPS_DEBUG_EN
206
CFLAGS += -DIPS_DEBUG_EN

modules/unification/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ include ../Makefile
88
# Include stb lib for compilation
99
INCLUDES += INCLUDES_STB
1010

11-
1211
# Defining preprocessor directive for using PV model
1312
ifdef IMG_UNIFICATE_PV_EN
1413
CFLAGS += -DIMG_UNIFICATE_PV_EN

0 commit comments

Comments
 (0)