Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
09269978
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
09269978
编写于
6月 30, 2011
作者:
A
Andrey Kamaev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added cmake script to build Android samples
上级
995ce4bd
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
119 addition
and
43 deletion
+119
-43
CMakeLists.txt
CMakeLists.txt
+3
-2
android/scripts/cmake_android.sh
android/scripts/cmake_android.sh
+1
-1
modules/java/CMakeLists.txt
modules/java/CMakeLists.txt
+7
-0
samples/CMakeLists.txt
samples/CMakeLists.txt
+8
-1
samples/android/0-base/default.properties
samples/android/0-base/default.properties
+1
-10
samples/android/1-java/default.properties
samples/android/1-java/default.properties
+1
-10
samples/android/2-native/default.properties
samples/android/2-native/default.properties
+0
-9
samples/android/4-mixed/default.properties
samples/android/4-mixed/default.properties
+1
-10
samples/android/CMakeLists.txt
samples/android/CMakeLists.txt
+97
-0
未找到文件。
CMakeLists.txt
浏览文件 @
09269978
...
...
@@ -697,11 +697,12 @@ if (BUILD_JAVA_SUPPORT AND (BUILD_EXAMPLES OR BUILD_TESTS))
OUTPUT_VARIABLE ANT_VERSION_FULL
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string
(
REGEX MATCH
"[0-9]+.[0-9]+.[0-9]+"
ANT_VERSION
"
${
ANT_VERSION_FULL
}
"
)
message
(
STATUS
" Found apache ant
${
ANT_VERSION
}
:
${
ANT_EXECUTABLE
}
"
)
endif
()
if
(
ANDROID_EXECUTABLE AND ANT_EXECUTABLE AND ANT_VERSION VERSION_GREATER 1.8
)
if
(
ANDROID_EXECUTABLE AND ANT_EXECUTABLE
AND
(
ANT_VERSION VERSION_GREATER 1.7.-1
))
SET
(
CAN_BUILD_ANDROID_PROJECTS TRUE
)
else
()
SET
(
CAN_BUILD_ANDROID_PROJECTS FALSE
)
...
...
android/scripts/cmake_android.sh
浏览文件 @
09269978
...
...
@@ -4,5 +4,5 @@ cd `dirname $0`/..
mkdir
-p
build
cd
build
cmake
-C
../CMakeCache.android.initial.cmake
-DCMAKE_TOOLCHAIN_FILE
=
../android.toolchain.cmake ../..
cmake
-C
../CMakeCache.android.initial.cmake
-DCMAKE_TOOLCHAIN_FILE
=
../android.toolchain.cmake
$@
../..
modules/java/CMakeLists.txt
浏览文件 @
09269978
...
...
@@ -12,6 +12,8 @@ ENDIF()
SET
(
GEN_JAVA
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/gen_java.py"
)
SET
(
HDR_PARSER
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../python/src2/hdr_parser.py"
)
SET
(
additional_clean_files
""
)
foreach
(
module
${
OPENCV_JAVA_MODULES
}
)
IF
(
EXISTS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/config/
${
module
}
.filelist"
)
FILE
(
STRINGS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/config/
${
module
}
.filelist"
headers_to_parse
)
...
...
@@ -100,6 +102,7 @@ IF(ANDROID)
COMMENT
"Generating
${
lib_file_name
}
"
)
install
(
FILES
"
${
CMAKE_BINARY_DIR
}
/
${
lib_file_name
}
"
DESTINATION . COMPONENT main
)
LIST
(
APPEND additional_clean_files
"
${
CMAKE_BINARY_DIR
}
/
${
lib_file_name
}
"
)
endif
()
endforeach
()
...
...
@@ -111,6 +114,7 @@ IF(ANDROID)
DEPENDS
"
${
jni_file
}
"
COMMENT
"Generating jni/
${
jni_file_name
}
"
)
LIST
(
APPEND additional_clean_files
"
${
CMAKE_BINARY_DIR
}
/jni/
${
jni_file_name
}
"
)
endforeach
()
ENDIF
()
...
...
@@ -126,8 +130,11 @@ foreach(java_file ${java_project_files} ${generated_java_sources})
DEPENDS
"
${
JAVA_OUTPUT_DIR
}
"
COMMENT
"Generating src/org/opencv/
${
java_file_name
}
"
)
LIST
(
APPEND additional_clean_files
"
${
JAVA_OUTPUT_DIR
}
/
${
java_file_name
}
"
)
if
(
ANDROID
)
install
(
FILES
"
${
JAVA_OUTPUT_DIR
}
/
${
java_file_name
}
"
DESTINATION src/org/opencv COMPONENT main
)
endif
()
endforeach
()
set_directory_properties
(
PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"
${
additional_clean_files
}
"
)
samples/CMakeLists.txt
浏览文件 @
09269978
...
...
@@ -5,7 +5,14 @@
add_subdirectory
(
c
)
add_subdirectory
(
cpp
)
add_subdirectory
(
gpu
)
if
(
NOT ANDROID
)
add_subdirectory
(
gpu
)
endif
()
if
(
ANDROID AND CAN_BUILD_ANDROID_PROJECTS
)
add_subdirectory
(
android
)
endif
()
if
(
0
)
add_subdirectory
(
swig_python
)
...
...
samples/android/0-base/default.properties
浏览文件 @
09269978
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
# Project target.
target
=
android-8
\ No newline at end of file
target
=
android-8
samples/android/1-java/default.properties
浏览文件 @
09269978
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
android.library.reference.1
=
../../../android/build
# Project target.
target
=
android-8
android.library.reference.1
=
../../../android/build
samples/android/2-native/default.properties
浏览文件 @
09269978
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
# Project target.
target
=
android-8
samples/android/4-mixed/default.properties
浏览文件 @
09269978
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
android.library.reference.1
=
../../../android/build
# Project target.
target
=
android-8
android.library.reference.1
=
../../../android/build
samples/android/CMakeLists.txt
0 → 100644
浏览文件 @
09269978
# ----------------------------------------------------------------------------
# CMake file for Android samples. See root CMakeLists.txt
#
# ----------------------------------------------------------------------------
if
(
BUILD_EXAMPLES
)
project
(
android_samples
)
include_directories
(
"
${
CMAKE_SOURCE_DIR
}
/modules/core/include"
"
${
CMAKE_SOURCE_DIR
}
/modules/flann/include"
"
${
CMAKE_SOURCE_DIR
}
/modules/imgproc/include"
"
${
CMAKE_SOURCE_DIR
}
/modules/video/include"
"
${
CMAKE_SOURCE_DIR
}
/modules/highgui/include"
"
${
CMAKE_SOURCE_DIR
}
/modules/ml/include"
"
${
CMAKE_SOURCE_DIR
}
/modules/calib3d/include"
"
${
CMAKE_SOURCE_DIR
}
/modules/features2d/include"
"
${
CMAKE_SOURCE_DIR
}
/modules/objdetect/include"
"
${
CMAKE_SOURCE_DIR
}
/modules/legacy/include"
"
${
CMAKE_SOURCE_DIR
}
/modules/contrib/include"
)
SET
(
sample_dependencies opencv_contrib opencv_legacy opencv_objdetect opencv_calib3d opencv_features2d opencv_video opencv_highgui opencv_ml opencv_imgproc opencv_flann opencv_core
)
if
(
NOT BUILD_SHARED_LIBS
)
LIST
(
APPEND sample_dependencies opencv_androidcamera
)
endif
()
SET
(
additional_clean_files
""
)
macro
(
ADD_ANDROID_SAMPLE sample_name
)
#message(STATUS "Build android sample: '${sample_name}'")
SET
(
sample_dir
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
sample
}
"
)
add_custom_target
(
${
sample
}
ALL
)
add_dependencies
(
${
sample
}
opencv_java opencv_java_api
)
set_target_properties
(
${
sample
}
PROPERTIES
PROJECT_LABEL
"(ANDROID EXAMPLE)
${
sample
}
"
)
file
(
RELATIVE_PATH OPENCV_REFERENCE_PATH
"
${
sample_dir
}
"
"
${
CMAKE_BINARY_DIR
}
"
)
if
(
NOT
(
"
${
sample
}
"
STREQUAL
"0-base"
OR
"
${
sample
}
"
STREQUAL
"2-native"
))
SET
(
opencv_reference --library \"
${
OPENCV_REFERENCE_PATH
}
\"
)
else
()
SET
(
opencv_reference
)
endif
()
add_custom_command
(
TARGET
${
sample
}
WORKING_DIRECTORY
${
sample_dir
}
COMMAND
${
CMAKE_COMMAND
}
-E remove -f
"
${
sample_dir
}
/default.properties"
COMMAND
${
CMAKE_COMMAND
}
-E touch
"
${
sample_dir
}
/default.properties"
COMMAND
${
ANDROID_EXECUTABLE
}
update project --name
"
${
sample
}
"
--target 7
${
opencv_reference
}
--path .
COMMAND
${
ANT_EXECUTABLE
}
debug
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
sample_dir
}
/bin/
${
sample
}
-debug.apk"
"
${
CMAKE_BINARY_DIR
}
/bin/
${
sample
}
-debug.apk"
)
LIST
(
APPEND additional_clean_files
"
${
CMAKE_BINARY_DIR
}
/bin/
${
sample
}
-debug.apk"
"
${
sample_dir
}
/build.xml"
"
${
sample_dir
}
/local.properties"
"
${
sample_dir
}
/proguard.cfg"
)
if
(
IS_DIRECTORY
"
${
sample_dir
}
/jni"
)
INCLUDE_DIRECTORIES
(
"
${
sample_dir
}
/jni"
)
FILE
(
GLOB srcs
"
${
sample_dir
}
/jni/*.cpp"
)
FILE
(
STRINGS
"
${
sample_dir
}
/jni/Android.mk"
JNI_LIB_NAME REGEX
"LOCAL_MODULE[ ]*:=[ ]*.*"
)
string
(
REGEX REPLACE
"LOCAL_MODULE[ ]*:=[ ]*([a-zA-Z_][a-zA-Z_0-9]*)[ ]*"
"
\\
1"
JNI_LIB_NAME
"
${
JNI_LIB_NAME
}
"
)
ADD_LIBRARY
(
${
JNI_LIB_NAME
}
MODULE
${
srcs
}
)
ADD_DEPENDENCIES
(
${
JNI_LIB_NAME
}
${
sample_dependencies
}
)
TARGET_LINK_LIBRARIES
(
${
JNI_LIB_NAME
}
${
OPENCV_LINKER_LIBS
}
${
sample_dependencies
}
)
set_target_properties
(
${
JNI_LIB_NAME
}
PROPERTIES
OUTPUT_NAME
"
${
JNI_LIB_NAME
}
"
LIBRARY_OUTPUT_DIRECTORY
"
${
sample_dir
}
/libs/
${
ARMEABI_NDK_NAME
}
"
)
ADD_CUSTOM_COMMAND
(
TARGET
${
JNI_LIB_NAME
}
POST_BUILD
COMMAND
${
CMAKE_STRIP
}
"
${
sample_dir
}
/libs/
${
ARMEABI_NDK_NAME
}
/*.so"
)
add_dependencies
(
${
sample
}
${
JNI_LIB_NAME
}
)
endif
()
endmacro
()
file
(
GLOB android_samples RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
*
)
list
(
SORT android_samples
)
foreach
(
sample
${
android_samples
}
)
if
(
EXISTS
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
sample
}
/AndroidManifest.xml
)
ADD_ANDROID_SAMPLE
(
${
sample
}
)
endif
()
endforeach
()
set_directory_properties
(
PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"
${
additional_clean_files
}
"
)
endif
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录