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.
pull/5179/head
Alexander Alekhin 9 years ago
parent d789c810bf
commit e1ad86c1fa
  1. 10
      samples/android/face-detection/jni/Android.mk
  2. 10
      samples/android/tutorial-2-mixedprocessing/jni/Android.mk
  3. 10
      samples/android/tutorial-4-opencl/jni/Android.mk

@ -5,7 +5,15 @@ include $(CLEAR_VARS)
#OPENCV_CAMERA_MODULES:=off
#OPENCV_INSTALL_MODULES:=off
#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_C_INCLUDES += $(LOCAL_PATH)

@ -2,7 +2,15 @@ LOCAL_PATH := $(call my-dir)
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_SRC_FILES := jni_part.cpp

@ -3,10 +3,14 @@ LOCAL_PATH := $(call my-dir)
# add OpenCV
include $(CLEAR_VARS)
OPENCV_INSTALL_MODULES:=on
ifeq ($(O4A_SDK_ROOT),)
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 $(O4A_SDK_ROOT)/sdk/native/jni/OpenCV.mk
include ../../sdk/native/jni/OpenCV.mk
endif
# add OpenCL

Loading…
Cancel
Save