Skip to content

Instantly share code, notes, and snippets.

@Sren-Hmkn
Created August 6, 2018 09:54
Show Gist options
  • Save Sren-Hmkn/135d78656b23766b665a0bdbb9ff9b66 to your computer and use it in GitHub Desktop.
Save Sren-Hmkn/135d78656b23766b665a0bdbb9ff9b66 to your computer and use it in GitHub Desktop.
Android.mk for NDK and OpenCV setup
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_ROOT:={MY PATH TO OpenCV-android-sdk - i.e. home/soeren/OpenCV-android-sdk}
OPENCV_CAMERA_MODULES:=on
OPENCV_INSTALL_MODULES:=on
OPENCV_LIB_TYPE:=SHARED
include ${OPENCV_ROOT}/sdk/native/jni/OpenCV.mk
NDK_MODULE_PATH={MY PATH TO ANDROID NDK ... /ndk-bundle}
LOCAL_ARM_NEON := true
LOCAL_SRC_FILES :=
LOCAL_CPPFLAGS := -std=gnu++0x
LOCAL_CFLAGS += -O2
LOCAL_LDLIBS += -llog -ldl
LOCAL_MODULE := native
include $(BUILD_SHARED_LIBRARY)
@Nalbornoz
Copy link

The OPENCV_ROOT must be inside of {} ?

@srnvnsbln
Copy link

I think so. Did you try it without?

@meomunm
Copy link

meomunm commented Feb 26, 2021

The OPENCV_ROOT must be inside of {} ?

OPENCV_ROOT is repo path environment variable of OPENCV_SDK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment