android samples: update way to attach native part of OpenCV

OPENCV_ANDROID_SDK - OpenCV Android SDK location (or OpenCV build dir)
Can be passed via ndk-build parameter or environment variable.
This commit is contained in:
Alexander Alekhin 2015-08-12 17:06:36 +03:00
parent d789c810bf
commit e1ad86c1fa
3 changed files with 25 additions and 5 deletions

View File

@ -5,7 +5,15 @@ include $(CLEAR_VARS)
#OPENCV_CAMERA_MODULES:=off #OPENCV_CAMERA_MODULES:=off
#OPENCV_INSTALL_MODULES:=off #OPENCV_INSTALL_MODULES:=off
#OPENCV_LIB_TYPE:=SHARED #OPENCV_LIB_TYPE:=SHARED
include ../../sdk/native/jni/OpenCV.mk ifdef OPENCV_ANDROID_SDK
ifneq ("","$(wildcard $(OPENCV_ANDROID_SDK)/OpenCV.mk)")
include ${OPENCV_ANDROID_SDK}/OpenCV.mk
else
include ${OPENCV_ANDROID_SDK}/sdk/native/jni/OpenCV.mk
endif
else
include ../../sdk/native/jni/OpenCV.mk
endif
LOCAL_SRC_FILES := DetectionBasedTracker_jni.cpp LOCAL_SRC_FILES := DetectionBasedTracker_jni.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH) LOCAL_C_INCLUDES += $(LOCAL_PATH)

View File

@ -2,7 +2,15 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) include $(CLEAR_VARS)
include ../../sdk/native/jni/OpenCV.mk ifdef OPENCV_ANDROID_SDK
ifneq ("","$(wildcard $(OPENCV_ANDROID_SDK)/OpenCV.mk)")
include ${OPENCV_ANDROID_SDK}/OpenCV.mk
else
include ${OPENCV_ANDROID_SDK}/sdk/native/jni/OpenCV.mk
endif
else
include ../../sdk/native/jni/OpenCV.mk
endif
LOCAL_MODULE := mixed_sample LOCAL_MODULE := mixed_sample
LOCAL_SRC_FILES := jni_part.cpp LOCAL_SRC_FILES := jni_part.cpp

View File

@ -3,10 +3,14 @@ LOCAL_PATH := $(call my-dir)
# add OpenCV # add OpenCV
include $(CLEAR_VARS) include $(CLEAR_VARS)
OPENCV_INSTALL_MODULES:=on OPENCV_INSTALL_MODULES:=on
ifeq ($(O4A_SDK_ROOT),) ifdef OPENCV_ANDROID_SDK
include ../../sdk/native/jni/OpenCV.mk ifneq ("","$(wildcard $(OPENCV_ANDROID_SDK)/OpenCV.mk)")
include ${OPENCV_ANDROID_SDK}/OpenCV.mk
else
include ${OPENCV_ANDROID_SDK}/sdk/native/jni/OpenCV.mk
endif
else else
include $(O4A_SDK_ROOT)/sdk/native/jni/OpenCV.mk include ../../sdk/native/jni/OpenCV.mk
endif endif
# add OpenCL # add OpenCL