mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 11:10:21 +08:00
OpenCV.mk fixed for accurate CUDA support.
This commit is contained in:
parent
f22d9a232d
commit
58e7d9f32f
@ -19,6 +19,10 @@ if(ANDROID)
|
||||
set(OPENCV_STATIC_LIBTYPE_CONFIGMAKE ${OPENCV_LIBTYPE_CONFIGMAKE})
|
||||
endif()
|
||||
|
||||
if (HAVE_opencv_gpu)
|
||||
set(OPENCV_PREBUILT_GPU_MODULE_CONFIGMAKE "on")
|
||||
endif()
|
||||
|
||||
# setup lists of camera libs
|
||||
foreach(abi ARMEABI ARMEABI_V7A X86 MIPS)
|
||||
ANDROID_GET_ABI_RAWNAME(${abi} ndkabi)
|
||||
@ -48,7 +52,7 @@ if(ANDROID)
|
||||
set(OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE "")
|
||||
foreach(m ${OPENCV_MODULES_PUBLIC})
|
||||
list(INSERT OPENCV_MODULES_CONFIGMAKE 0 ${${m}_MODULE_DEPS_${ocv_optkind}} ${m})
|
||||
if(${m}_EXTRA_DEPS_${ocv_optkind})
|
||||
if(${m}_EXTRA_DEPS_${ocv_optkind} AND NOT ${m}_EXTRA_DEPS_${ocv_optkind} MATCHES "libcu.+$")
|
||||
list(INSERT OPENCV_EXTRA_COMPONENTS_CONFIGMAKE 0 ${${m}_EXTRA_DEPS_${ocv_optkind}})
|
||||
endif()
|
||||
endforeach()
|
||||
|
@ -13,6 +13,19 @@ OPENCV_BASEDIR:=@OPENCV_BASE_INCLUDE_DIR_CONFIGCMAKE@
|
||||
OPENCV_LOCAL_C_INCLUDES:=@OPENCV_INCLUDE_DIRS_CONFIGCMAKE@
|
||||
OPENCV_MODULES:=@OPENCV_MODULES_CONFIGMAKE@
|
||||
|
||||
OPENCV_PREBUILT_GPU_MODULE:=@OPENCV_PREBUILT_GPU_MODULE_CONFIGMAKE@
|
||||
OPENCV_USE_GPU_MODULE:=
|
||||
|
||||
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||
ifeq ($(OPENCV_PREBUILT_GPU_MODULE),on)
|
||||
ifneq ($(CUDA_TOOLKIT_DIR),)
|
||||
OPENCV_USE_GPU_MODULE:=on
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
CUDA_RUNTIME_LIBS:=cufft npps nppi nppc cudart
|
||||
|
||||
ifeq ($(OPENCV_LIB_TYPE),)
|
||||
OPENCV_LIB_TYPE:=@OPENCV_LIBTYPE_CONFIGMAKE@
|
||||
endif
|
||||
@ -108,6 +121,13 @@ ifeq ($(OPENCV_MK_$(OPENCV_TARGET_ARCH_ABI)_ALREADY_INCLUDED),)
|
||||
OPENCV_MK_$(OPENCV_TARGET_ARCH_ABI)_ALREADY_INCLUDED:=on
|
||||
endif
|
||||
|
||||
ifeq ($(OPENCV_USE_GPU_MODULE),on)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE:=opencv_gpu
|
||||
LOCAL_SRC_FILES:=$(OPENCV_LIBS_DIR)/libopencv_gpu.a
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
endif
|
||||
|
||||
ifeq ($(OPENCV_LOCAL_CFLAGS),)
|
||||
OPENCV_LOCAL_CFLAGS := -fPIC -DANDROID -fsigned-char
|
||||
endif
|
||||
@ -116,6 +136,10 @@ include $(CLEAR_VARS)
|
||||
LOCAL_C_INCLUDES += $(OPENCV_LOCAL_C_INCLUDES)
|
||||
LOCAL_CFLAGS += $(OPENCV_LOCAL_CFLAGS)
|
||||
|
||||
ifeq ($(OPENCV_USE_GPU_MODULE),on)
|
||||
LOCAL_C_INCLUDES += $(CUDA_TOOLKIT_DIR)/include
|
||||
endif
|
||||
|
||||
ifeq ($(OPENCV_INSTALL_MODULES),on)
|
||||
LOCAL_$(OPENCV_LIB_TYPE)_LIBRARIES += $(foreach mod, $(OPENCV_LIBS), opencv_$(mod))
|
||||
else
|
||||
@ -128,5 +152,10 @@ endif
|
||||
|
||||
LOCAL_LDLIBS += $(foreach lib,$(OPENCV_EXTRA_COMPONENTS), -l$(lib))
|
||||
|
||||
ifeq ($(OPENCV_USE_GPU_MODULE),on)
|
||||
LOCAL_STATIC_LIBRARIES+=libopencv_gpu
|
||||
LOCAL_LDLIBS += -L$(CUDA_TOOLKIT_DIR)/lib $(foreach lib, $(CUDA_RUNTIME_LIBS), -l$(lib))
|
||||
endif
|
||||
|
||||
#restore the LOCAL_PATH
|
||||
LOCAL_PATH:=$(USER_LOCAL_PATH)
|
||||
|
Loading…
Reference in New Issue
Block a user