2011-06-28 13:34:41 +02:00
|
|
|
# In order to compile your application under cygwin
|
2012-02-03 12:26:49 +01:00
|
|
|
# you might need to define NDK_USE_CYGPATH=1 before calling the ndk-build
|
2011-06-28 13:34:41 +02:00
|
|
|
|
2011-06-28 10:48:23 +02:00
|
|
|
USER_LOCAL_PATH:=$(LOCAL_PATH)
|
2011-06-28 13:34:41 +02:00
|
|
|
LOCAL_PATH:=$(subst ?,,$(firstword ?$(subst \, ,$(subst /, ,$(call my-dir)))))
|
2011-06-28 10:48:23 +02:00
|
|
|
|
|
|
|
OPENCV_THIS_DIR:=$(patsubst $(LOCAL_PATH)\\%,%,$(patsubst $(LOCAL_PATH)/%,%,$(call my-dir)))
|
2012-02-03 12:26:49 +01:00
|
|
|
OPENCV_LIBS_DIR:=@OPENCV_LIBS_DIR_CONFIGCMAKE@
|
|
|
|
OPENCV_BASEDIR:=@OPENCV_BASE_INCLUDE_DIR_CONFIGCMAKE@
|
|
|
|
OPENCV_LOCAL_C_INCLUDES:=@OPENCV_INCLUDE_DIRS_CONFIGCMAKE@
|
2011-06-20 17:35:05 +02:00
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
OPENCV_LIB_TYPE:=@OPENCV_LIBTYPE_CONFIGMAKE@
|
|
|
|
OPENCV_MODULES:=@OPENCV_MODULES_CONFIGMAKE@
|
|
|
|
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE@
|
|
|
|
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
|
2011-06-20 17:35:05 +02:00
|
|
|
|
2011-06-29 15:18:20 +02:00
|
|
|
ifeq (${OPENCV_CAMERA_MODULES},off)
|
2011-07-04 13:41:39 +02:00
|
|
|
OPENCV_CAMERA_MODULES:=
|
2011-06-29 15:18:20 +02:00
|
|
|
else
|
2012-02-03 12:26:49 +01:00
|
|
|
ifeq ($(TARGET_ARCH_ABI),armeabi)
|
|
|
|
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_ARMEABI_CONFIGCMAKE@
|
|
|
|
endif
|
|
|
|
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
|
|
|
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_ARMEABI_V7A_CONFIGCMAKE@
|
|
|
|
endif
|
|
|
|
ifeq ($(TARGET_ARCH_ABI),x86)
|
|
|
|
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_X86_CONFIGCMAKE@
|
|
|
|
endif
|
2011-06-29 15:18:20 +02:00
|
|
|
endif
|
2011-06-28 10:48:23 +02:00
|
|
|
|
2011-06-20 17:35:05 +02:00
|
|
|
ifeq ($(OPENCV_LIB_TYPE),SHARED)
|
|
|
|
OPENCV_LIB_SUFFIX:=so
|
|
|
|
else
|
|
|
|
OPENCV_LIB_SUFFIX:=a
|
|
|
|
endif
|
|
|
|
|
|
|
|
define add_opencv_module
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE:=opencv_$1
|
2011-06-28 10:48:23 +02:00
|
|
|
LOCAL_SRC_FILES:=$(OPENCV_LIBS_DIR)/libs/$(TARGET_ARCH_ABI)/libopencv_$1.$(OPENCV_LIB_SUFFIX)
|
2011-06-20 17:35:05 +02:00
|
|
|
include $(PREBUILT_@OPENCV_LIBTYPE_CONFIGMAKE@_LIBRARY)
|
|
|
|
endef
|
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
define add_opencv_3rdparty_component
|
2011-06-20 17:35:05 +02:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE:=$1
|
2011-06-28 10:48:23 +02:00
|
|
|
LOCAL_SRC_FILES:=$(OPENCV_THIS_DIR)/3rdparty/libs/$(TARGET_ARCH_ABI)/lib$1.a
|
2011-06-20 17:35:05 +02:00
|
|
|
include $(PREBUILT_STATIC_LIBRARY)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define add_opencv_camera_module
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE:=$1
|
2011-06-28 10:48:23 +02:00
|
|
|
LOCAL_SRC_FILES:=$(OPENCV_LIBS_DIR)/libs/$(TARGET_ARCH_ABI)/lib$1.so
|
2011-06-20 17:35:05 +02:00
|
|
|
include $(PREBUILT_SHARED_LIBRARY)
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach module,$(OPENCV_MODULES),$(eval $(call add_opencv_module,$(module))))
|
2012-02-03 12:26:49 +01:00
|
|
|
$(foreach module,$(OPENCV_3RDPARTY_COMPONENTS),$(eval $(call add_opencv_3rdparty_component,$(module))))
|
2011-06-20 17:35:05 +02:00
|
|
|
$(foreach module,$(OPENCV_CAMERA_MODULES),$(eval $(call add_opencv_camera_module,$(module))))
|
|
|
|
|
|
|
|
ifneq ($(OPENCV_BASEDIR),)
|
|
|
|
OPENCV_LOCAL_C_INCLUDES += $(foreach mod, $(OPENCV_MODULES), $(OPENCV_BASEDIR)/modules/$(mod)/include)
|
|
|
|
endif
|
|
|
|
|
2011-06-28 10:48:23 +02:00
|
|
|
ifeq ($(OPENCV_LIB_TYPE),STATIC)
|
|
|
|
OPENCV_LOCAL_LIBRARIES += $(foreach mod, $(OPENCV_MODULES), opencv_$(mod))
|
|
|
|
endif
|
|
|
|
|
2011-06-20 17:35:05 +02:00
|
|
|
OPENCV_LOCAL_LIBRARIES += $(OPENCV_EXTRA_COMPONENTS)
|
2011-06-28 10:48:23 +02:00
|
|
|
OPENCV_LOCAL_CFLAGS := -fPIC -DANDROID -fsigned-char
|
2011-06-20 17:35:05 +02:00
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_C_INCLUDES += $(OPENCV_LOCAL_C_INCLUDES)
|
|
|
|
LOCAL_STATIC_LIBRARIES += $(OPENCV_LOCAL_LIBRARIES)
|
|
|
|
LOCAL_CFLAGS += $(OPENCV_LOCAL_CFLAGS)
|
2012-02-03 12:26:49 +01:00
|
|
|
LOCAL_LDLIBS += $(foreach lib,$(OPENCV_EXTRA_COMPONENTS), -l$(lib))
|
2011-06-28 10:48:23 +02:00
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
#restore the LOCAL_PATH
|
2011-06-28 10:48:23 +02:00
|
|
|
LOCAL_PATH:=$(USER_LOCAL_PATH)
|