Merge pull request #2040 from asmorkalov:android_mk_fix

This commit is contained in:
Roman Donchenko 2013-12-23 18:02:18 +04:00 committed by OpenCV Buildbot
commit edce617a58
3 changed files with 34 additions and 1 deletions

View File

@ -53,6 +53,11 @@ if(ANDROID)
endif()
endforeach()
# remove CUDA runtime and NPP from regular deps
# it can be added seporately if needed.
ocv_list_filterout(OPENCV_EXTRA_COMPONENTS_CONFIGMAKE "libcu")
ocv_list_filterout(OPENCV_EXTRA_COMPONENTS_CONFIGMAKE "libnpp")
# split 3rdparty libs and modules
foreach(mod ${OPENCV_MODULES_CONFIGMAKE})
if(NOT mod MATCHES "^opencv_.+$")

View File

@ -13,6 +13,18 @@ OPENCV_BASEDIR:=@OPENCV_BASE_INCLUDE_DIR_CONFIGCMAKE@
OPENCV_LOCAL_C_INCLUDES:=@OPENCV_INCLUDE_DIRS_CONFIGCMAKE@
OPENCV_MODULES:=@OPENCV_MODULES_CONFIGMAKE@
OPENCV_USE_GPU_MODULE:=
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
ifneq ($(findstring gpu,$(OPENCV_MODULES)),)
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 +120,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 +135,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 +151,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)

View File

@ -1,4 +1,4 @@
if(NOT DYNAMIC_CUDA_SUPPORT)
if(NOT ENABLE_DYNAMIC_CUDA)
ocv_module_disable(dynamicuda)
endif()