From: Jeff Donahue Date: Wed, 15 Oct 2014 04:03:03 +0000 (-0700) Subject: Reintroduce pkg-config with optional Makefile.config flag. X-Git-Tag: submit/tizen/20180823.020014~572^2~110^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8944b7addcff7be6947c255db7ee85881d1b586d;p=platform%2Fupstream%2Fcaffeonacl.git Reintroduce pkg-config with optional Makefile.config flag. --- diff --git a/Makefile b/Makefile index 35c37af..26d5964 100644 --- a/Makefile +++ b/Makefile @@ -329,7 +329,14 @@ NVCCFLAGS += -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS) # mex may invoke an older gcc that is too liberal with -Wuninitalized MATLAB_CXXFLAGS := $(CXXFLAGS) -Wno-uninitialized LINKFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS) -LDFLAGS += $(foreach librarydir,$(LIBRARY_DIRS),-L$(librarydir)) \ + +USE_PKG_CONFIG ?= 0 +ifeq ($(USE_PKG_CONFIG), 1) + PKG_CONFIG := $(shell pkg-config opencv --libs) +else + PKG_CONFIG := +endif +LDFLAGS += $(foreach librarydir,$(LIBRARY_DIRS),-L$(librarydir)) $(PKG_CONFIG) \ $(foreach library,$(LIBRARIES),-l$(library)) PYTHON_LDFLAGS := $(LDFLAGS) $(foreach library,$(PYTHON_LIBRARIES),-l$(library)) diff --git a/Makefile.config.example b/Makefile.config.example index 5cb0b24..b6d95e3 100644 --- a/Makefile.config.example +++ b/Makefile.config.example @@ -60,6 +60,10 @@ PYTHON_LIB := /usr/lib INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib +# Uncomment to use `pkg-config` to specify OpenCV library paths. +# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.) +# USE_PKG_CONFIG := 1 + BUILD_DIR := build DISTRIBUTE_DIR := distribute