From: Ethan Rublee Date: Wed, 22 Sep 2010 13:24:37 +0000 (+0000) Subject: fixing a bug in the local.env.mk setup, and correcting the readme's X-Git-Tag: accepted/2.0/20130307.220821~4464 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96e127134dbf48622e0e808afc7ad11098fbe8a1;p=profile%2Fivi%2Fopencv.git fixing a bug in the local.env.mk setup, and correcting the readme's Also, the androi-opencv.mk.in wasn't correct for one of the crystax NDK build directory setups --- diff --git a/android/android-jni/README.txt b/android/android-jni/README.txt index 65ea912..3f7862f 100644 --- a/android/android-jni/README.txt +++ b/android/android-jni/README.txt @@ -7,10 +7,10 @@ into native opencv functions(as cv::Mat's) to build make sure you have swig and the crystax ndk in your path -cp sample.local.env.mk local.env.mk make -that should work... +that should work... If it doesn't make sure to edit the generated local.env.mk +the key variable more later on how to build actual project for android - see the code.google.com/p/android-opencv for details on this diff --git a/android/android-jni/sample.env.mk b/android/android-jni/sample.env.mk deleted file mode 100644 index 7f27b64..0000000 --- a/android/android-jni/sample.env.mk +++ /dev/null @@ -1,4 +0,0 @@ -#location of android-opencv port of OpenCV to android -OPENCV_CONFIG=../build/android-opencv.mk -ANDROID_NDK_ROOT=$(HOME)/android-ndk-r4-crystax - diff --git a/android/android-jni/sample.local.env.mk b/android/android-jni/sample.local.env.mk new file mode 100644 index 0000000..cea5d71 --- /dev/null +++ b/android/android-jni/sample.local.env.mk @@ -0,0 +1,8 @@ +#location of android-opencv.mk file that was generated by the cmake build +#of opencv for android +OPENCV_CONFIG=../build/android-opencv.mk + +#the root directory of the crystax r4 ndk - ndk-build should be in this dir +#you can download the ndk from http://www.crystax.net/android/ndk-r4.php +ANDROID_NDK_ROOT=$(HOME)/android-ndk-r4-crystax + diff --git a/android/android-opencv.mk.in b/android/android-opencv.mk.in index e9b4fcd..c57510e 100644 --- a/android/android-opencv.mk.in +++ b/android/android-opencv.mk.in @@ -14,14 +14,21 @@ ifndef OPENCV_BUILD_ROOT OPENCV_BUILD_ROOT := ${CMAKE_BINARY_DIR} endif -OPENCV_INCLUDES := ${android_module_include_dirs} $(OPENCV_ROOT)/android/android-jni/jni +OPENCV_INCLUDES := ${android_module_include_dirs} + ANDROID_OPENCV_INCLUDES := $(OPENCV_ROOT)/android/android-jni/jni -ARMOBJS := obj/local/armeabi -ARMOBJS_V7A := obj/local/armeabi-v7a -OPENCV_LIB_DIRS := -L$(OPENCV_BUILD_ROOT)/$(ARMOBJS_V7A) -L$(OPENCV_BUILD_ROOT)/$(ARMOBJS) +ARMOBJS := local/armeabi +ARMOBJS_V7A := local/armeabi-v7a + +OPENCV_LIB_DIRS := -L$(OPENCV_BUILD_ROOT)/obj/$(ARMOBJS_V7A) \ + -L$(OPENCV_BUILD_ROOT)/obj/$(ARMOBJS) -L$(OPENCV_BUILD_ROOT)/bin/ndk/$(ARMOBJS) \ + -L$(OPENCV_BUILD_ROOT)/bin/ndk/$(ARMOBJS_V7A) -ANDROID_OPENCV_LIB_DIRS := -L$(OPENCV_ROOT)/android/android-jni/$(ARMOBJS_V7A) -L$(OPENCV_ROOT)/android/android-jni/$(ARMOBJS) +ANDROID_OPENCV_LIB_DIRS := -L$(OPENCV_ROOT)/android/android-jni/obj/$(ARMOBJS_V7A) \ + -L$(OPENCV_ROOT)/android/android-jni/obj/$(ARMOBJS) \ + -L$(OPENCV_ROOT)/android/android-jni/bin/ndk/$(ARMOBJS_V7A) \ + -L$(OPENCV_ROOT)/android/android-jni/bin/ndk/$(ARMOBJS) #order of linking very important ---- may have stuff out of order here, but #important that modules that are more dependent come first...