Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
78461db5
Commit
78461db5
authored
Nov 27, 2010
by
Ethan Rublee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CameraTemplate compiles... not sure if it runs.
parent
f7c17493
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
54 deletions
+47
-54
Makefile
android/apps/camera_template/Makefile
+37
-35
default.properties
android/apps/camera_template/default.properties
+1
-1
Android.mk
android/apps/camera_template/jni/Android.mk
+3
-16
Application.mk
android/apps/camera_template/jni/Application.mk
+2
-2
sample.local.env.mk
android/apps/camera_template/sample.local.env.mk
+4
-0
No files found.
android/apps/camera_template/Makefile
View file @
78461db5
#Re-usable Makefile template for
#Re-usable Makefile template for
#android-ndk + swig projects
#android-ndk + swig projects
#author: Ethan Rublee
#date: summer 2010
# The path to the NDK, requires crystax version r-4 for now, due to support
# The path to the NDK, requires crystax version r-4 for now, due to support
#for the standard library
# for the standard library
ifndef
ANDROID_NDK_BASE
ANDROID_NDK_BASE
=
$(HOME)
/android-ndk-r4-crystax
# load environment from local make file
$(info
default
ndk
location
set
ANDROID_NDK_BASE
=
$(ANDROID_NDK_BASE)
)
LOCAL_ENV_MK
=
local.env.mk
ifneq
"$(wildcard $(LOCAL_ENV_MK))"
""
include
$(LOCAL_ENV_MK)
else
$(shell
cp
sample.$(LOCAL_ENV_MK)
$(LOCAL_ENV_MK))
$(info ERROR local environement not setup! try
:
)
$(info
gedit
$(LOCAL_ENV_MK))
$(error
Please
setup
the
$(LOCAL_ENV_MK)
-
the
default
was
just
created')
endif
endif
ifndef
ARM_TARGETS
#define OPENCV_ROOT when calling this makefile
ARM_TARGETS
=
"armeabi armeabi-v7a"
#OPENCV_ROOT = $(ANDROID_NDK_BASE)/apps/opencv
ifndef
OPENCV_ROOT
$(error
Please
define
OPENCV_ROOT
with
something
like
the
command
\
make
OPENCV_ROOT
=
<opencv>
)
endif
endif
ANDROID_NDK_BASE
=
$(ANDROID_NDK_ROOT)
$(info
OPENCV_CONFIG
=
$(OPENCV_CONFIG)
)
ifndef
PROJECT_PATH
ifndef
PROJECT_PATH
$(info
PROJECT_PATH
defaulting
to
this
directory)
$(info
PROJECT_PATH
defaulting
to
this
directory)
PROJECT_PATH
=
.
PROJECT_PATH
=
.
endif
endif
$(info
OPENCV_ROOT
=
$(OPENCV_ROOT)
)
android_jni
=
../../android-jni/jni
# The name of the native library
# The name of the native library
LIBNAME
=
libfoobar.so
LIBNAME
=
libfoobar.so
...
@@ -42,46 +45,43 @@ SWIG_BASE = foobar
...
@@ -42,46 +45,43 @@ SWIG_BASE = foobar
#swig interface files are in jni/*.i
#swig interface files are in jni/*.i
SWIG_JAVA_OUT
=
$
(
wildcard
$(SWIG_JAVA_DIR)
/
*
.java
)
SWIG_JAVA_OUT
=
$
(
wildcard
$(SWIG_JAVA_DIR)
/
*
.java
)
SWIG_IS
=
$
(
wildcard jni/
*
.i
)
SWIG_IS
=
$
(
wildcard jni/
*
.i
)
#the main swig file that includes others
SWIG_MAIN
=
jni/foobar.i
SWIG_C_DIR
=
jni/gen
SWIG_C_OUT
=
$(SWIG_C_DIR)
/foo_swig.cpp
#the directory where the jni sources are
# Find all the C++ sources in the native folder
C_DIR
=
jni
SOURCES
=
$
(
wildcard jni/
*
.cpp
)
HEADERS
=
$
(
wildcard jni/
*
.h
)
#directory where to put generated files
ANDROID_MKS
=
$
(
wildcard jni/
*
.mk
)
#relative to the C_DIR
GEN_DIR
=
gen
#the c swig is generated and put into the jni/gen folder
SWIG_C_DIR
=
$(C_DIR)
/
$(GEN_DIR)
#this file - jin/gen/foobar_swig.cpp must be included in the Android.mk
BUILD_DEFS
=
OPENCV_CONFIG
=
$(OPENCV_CONFIG)
\
#for it to be built!
PROJECT_PATH
=
$(PROJECT_PATH)
\
SWIG_C_OUT
=
$(SWIG_C_DIR)
/
$(SWIG_BASE)
_swig.cpp
V
=
$(V)
\
$(NDK_FLAGS)
\
ARM_TARGETS
=
$(ARM_TARGETS)
\
SWIG_C_OUT
=
$(SWIG_C_OUT)
# The real native library stripped of symbols
# The real native library stripped of symbols
LIB
=
libs/armeabi-v7a/
$(LIBNAME)
libs/armeabi/
$(LIBNAME)
LIB
=
libs/armeabi-v7a/
$(LIBNAME)
libs/armeabi/
$(LIBNAME)
# Find all the C++ sources in the native folder
SOURCES
=
$
(
wildcard jni/
*
.cpp
)
HEADERS
=
$
(
wildcard jni/
*
.h
)
ANDROID_MKS
=
$
(
wildcard jni/
*
.mk
)
#this gets called by the make command
all
:
$(LIB)
all
:
$(LIB)
#calls the ndk-build script, passing it OPENCV_ROOT and OPENCV_LIBS_DIR
#calls the ndk-build script, passing it OPENCV_ROOT and OPENCV_LIBS_DIR
$(LIB)
:
$(SWIG_C_OUT) $(SOURCES) $(HEADERS) $(ANDROID_MKS)
$(LIB)
:
$(SWIG_C_OUT) $(SOURCES) $(HEADERS) $(ANDROID_MKS)
$(ANDROID_NDK_BASE)
/ndk-build
OPENCV_ROOT
=
$(OPENCV_ROOT)
\
$(ANDROID_NDK_BASE)
/ndk-build
$(BUILD_DEFS)
OPENCV_LIBS_DIR
=
$(OPENCV_LIBS_DIR)
PROJECT_PATH
=
$(PROJECT_PATH)
SWIG_C_OUT
=
$(GEN_DIR)
/
$(SWIG_BASE)
_swig.cpp
V
=
$(V)
$(NDK_FLAGS)
#this creates the swig wrappers
#this creates the swig wrappers
#-I$(OPENCV_ROOT)/android/jni is an additional swig include path
$(SWIG_C_OUT)
:
$(SWIG_IS)
$(SWIG_C_OUT)
:
$(SWIG_IS)
make clean-swig
&&
\
make clean-swig
&&
\
mkdir
-p
$(SWIG_C_DIR)
&&
\
mkdir
-p
$(SWIG_C_DIR)
&&
\
mkdir
-p
$(SWIG_JAVA_DIR)
&&
\
mkdir
-p
$(SWIG_JAVA_DIR)
&&
\
swig
-java
-c
++
-I
$(
OPENCV_ROOT)
/android/jni
-package
"
$(SWIG_JAVA_PACKAGE)
"
\
swig
-java
-c
++
-I
$(
android_jni)
-package
"
$(SWIG_JAVA_PACKAGE)
"
\
-outdir
$(SWIG_JAVA_DIR)
\
-outdir
$(SWIG_JAVA_DIR)
\
-o
$(SWIG_C_OUT)
$(SWIG_MAIN)
-o
$(SWIG_C_OUT)
$(SWIG_MAIN)
...
@@ -95,4 +95,6 @@ clean-swig:
...
@@ -95,4 +95,6 @@ clean-swig:
#does clean-swig and then uses the ndk-build clean
#does clean-swig and then uses the ndk-build clean
clean
:
clean-swig
clean
:
clean-swig
$(ANDROID_NDK_BASE)
/ndk-build clean
V
=
$(V)
$(NDK_FLAGS)
$(ANDROID_NDK_BASE)
/ndk-build clean
$(BUILD_DEFS)
android/apps/camera_template/default.properties
View file @
78461db5
...
@@ -7,6 +7,6 @@
...
@@ -7,6 +7,6 @@
# "build.properties", and override values to adapt the script to your
# "build.properties", and override values to adapt the script to your
# project structure.
# project structure.
android.library.reference.1
=
../../
opencv/android
/
android.library.reference.1
=
../../
android-jni
/
# Project target.
# Project target.
target
=
android-7
target
=
android-7
android/apps/camera_template/jni/Android.mk
View file @
78461db5
...
@@ -6,16 +6,8 @@ LOCAL_PATH := $(call my-dir)
...
@@ -6,16 +6,8 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(CLEAR_VARS)
#pass in OPENCV_ROOT or define it here
#define OPENCV_INCLUDES and OPENCV_LIBS
#OPENCV_ROOT := ~/android-opencv/opencv
include $(OPENCV_CONFIG)
ifndef OPENCV_ROOT
${error please define OPENCV_ROOT before this point!}
endif
#define OPENCV_INCLUDES
include $(OPENCV_ROOT)/includes.mk
#define OPENCV_LIBS
include $(OPENCV_ROOT)/libs.mk
LOCAL_LDLIBS += $(OPENCV_LIBS) $(ANDROID_OPENCV_LIBS) -llog -lGLESv2
LOCAL_LDLIBS += $(OPENCV_LIBS) $(ANDROID_OPENCV_LIBS) -llog -lGLESv2
...
@@ -23,14 +15,9 @@ LOCAL_C_INCLUDES += $(OPENCV_INCLUDES) $(ANDROID_OPENCV_INCLUDES)
...
@@ -23,14 +15,9 @@ LOCAL_C_INCLUDES += $(OPENCV_INCLUDES) $(ANDROID_OPENCV_INCLUDES)
LOCAL_MODULE := foobar
LOCAL_MODULE := foobar
ifndef SWIG_C_OUT
${error please define SWIG_C_OUT before this point!}
endif
#make sure to pass in SWIG_C_OUT=gen/foobar_swig.cpp
#make sure to pass in SWIG_C_OUT=gen/foobar_swig.cpp
#done in the makefile
#done in the makefile
LOCAL_SRC_FILES :=
${SWIG_C_OUT}
TestBar.cpp
LOCAL_SRC_FILES :=
gen/foo_swig.cpp
TestBar.cpp
include $(BUILD_SHARED_LIBRARY)
include $(BUILD_SHARED_LIBRARY)
android/apps/camera_template/jni/Application.mk
View file @
78461db5
# The ARMv7 is significanly faster due to the use of the hardware FPU
# The ARMv7 is significanly faster due to the use of the hardware FPU
APP_ABI := armeabi armeabi-v7a
APP_ABI := $(ARM_TARGETS)
\ No newline at end of file
\ No newline at end of file
android/apps/camera_template/sample.local.env.mk
0 → 100644
View file @
78461db5
#location of android-opencv port of OpenCV to android
OPENCV_CONFIG=../../build/android-opencv.mk
ANDROID_NDK_ROOT=$(HOME)/android-ndk-r4-crystax
ARM_TARGETS="armeabi armeabi-v7a"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment