Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
a897fc91
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
a897fc91
编写于
7月 18, 2019
作者:
G
Giles Payne
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add no_samples_build option to Android SDK build
上级
f6ec0cd8
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
35 addition
and
18 deletion
+35
-18
CMakeLists.txt
CMakeLists.txt
+2
-2
cmake/android/android_gradle_projects.cmake
cmake/android/android_gradle_projects.cmake
+23
-11
platforms/android/build_sdk.py
platforms/android/build_sdk.py
+8
-3
platforms/android/gradle-wrapper/gradle.properties
platforms/android/gradle-wrapper/gradle.properties
+1
-1
samples/CMakeLists.txt
samples/CMakeLists.txt
+1
-1
未找到文件。
CMakeLists.txt
浏览文件 @
a897fc91
...
...
@@ -964,7 +964,7 @@ if(BUILD_opencv_apps)
endif
()
# examples
if
(
BUILD_EXAMPLES OR BUILD_ANDROID_EXAMPLES OR INSTALL_PYTHON_EXAMPLES OR INSTALL_C_EXAMPLES
)
if
(
BUILD_EXAMPLES OR BUILD_ANDROID_EXAMPLES OR INSTALL_
ANDROID_EXAMPLES OR INSTALL_
PYTHON_EXAMPLES OR INSTALL_C_EXAMPLES
)
add_subdirectory
(
samples
)
endif
()
...
...
@@ -1199,7 +1199,7 @@ ocv_build_features_string(apps_status
IF BUILD_EXAMPLES THEN
"examples"
IF BUILD_opencv_apps THEN
"apps"
IF BUILD_ANDROID_SERVICE THEN
"android_service"
IF
BUILD_ANDROID_EXAMPLES
AND CAN_BUILD_ANDROID_PROJECTS THEN
"android_examples"
IF
(
BUILD_ANDROID_EXAMPLES OR INSTALL_ANDROID_EXAMPLES
)
AND CAN_BUILD_ANDROID_PROJECTS THEN
"android_examples"
ELSE
"-"
)
status
(
" Applications:"
"
${
apps_status
}
"
)
ocv_build_features_string
(
docs_status
...
...
cmake/android/android_gradle_projects.cmake
浏览文件 @
a897fc91
...
...
@@ -105,17 +105,29 @@ macro(add_android_project target path)
include ':
${
__dir
}
'
"
)
# build apk
set
(
APK_FILE
"
${
ANDROID_BUILD_BASE_DIR
}
/
${
__dir
}
/build/outputs/apk/release/
${
__dir
}
-
${
ANDROID_ABI
}
-release-unsigned.apk"
)
ocv_update
(
OPENCV_GRADLE_VERBOSE_OPTIONS
"-i"
)
add_custom_command
(
OUTPUT
"
${
APK_FILE
}
"
"
${
OPENCV_DEPHELPER
}
/android_sample_
${
__dir
}
"
COMMAND ./gradlew
${
OPENCV_GRADLE_VERBOSE_OPTIONS
}
"
${
__dir
}
:assemble"
COMMAND
${
CMAKE_COMMAND
}
-E touch
"
${
OPENCV_DEPHELPER
}
/android_sample_
${
__dir
}
"
WORKING_DIRECTORY
"
${
ANDROID_BUILD_BASE_DIR
}
"
DEPENDS
${
depends
}
opencv_java_android
COMMENT
"Building OpenCV Android sample project:
${
__dir
}
"
)
if
(
BUILD_ANDROID_EXAMPLES
)
# build apk
set
(
APK_FILE
"
${
ANDROID_BUILD_BASE_DIR
}
/
${
__dir
}
/build/outputs/apk/release/
${
__dir
}
-
${
ANDROID_ABI
}
-release-unsigned.apk"
)
ocv_update
(
OPENCV_GRADLE_VERBOSE_OPTIONS
"-i"
)
add_custom_command
(
OUTPUT
"
${
APK_FILE
}
"
"
${
OPENCV_DEPHELPER
}
/android_sample_
${
__dir
}
"
COMMAND ./gradlew
${
OPENCV_GRADLE_VERBOSE_OPTIONS
}
"
${
__dir
}
:assemble"
COMMAND
${
CMAKE_COMMAND
}
-E touch
"
${
OPENCV_DEPHELPER
}
/android_sample_
${
__dir
}
"
WORKING_DIRECTORY
"
${
ANDROID_BUILD_BASE_DIR
}
"
DEPENDS
${
depends
}
opencv_java_android
COMMENT
"Building OpenCV Android sample project:
${
__dir
}
"
)
else
()
# install only
# copy samples
add_custom_command
(
OUTPUT
"
${
OPENCV_DEPHELPER
}
/android_sample_
${
__dir
}
"
COMMAND
${
CMAKE_COMMAND
}
-E touch
"
${
OPENCV_DEPHELPER
}
/android_sample_
${
__dir
}
"
WORKING_DIRECTORY
"
${
ANDROID_BUILD_BASE_DIR
}
"
DEPENDS
${
depends
}
opencv_java_android
COMMENT
"Copying OpenCV Android sample project:
${
__dir
}
"
)
endif
()
file
(
REMOVE
"
${
OPENCV_DEPHELPER
}
/android_sample_
${
__dir
}
"
)
# force rebuild after CMake run
add_custom_target
(
android_sample_
${
__dir
}
ALL DEPENDS
"
${
OPENCV_DEPHELPER
}
/android_sample_
${
__dir
}
"
SOURCES
"
${
ANDROID_SAMPLE_MANIFEST_PATH
}
"
)
...
...
platforms/android/build_sdk.py
浏览文件 @
a897fc91
...
...
@@ -151,6 +151,7 @@ class Builder:
self
.
ninja_path
=
self
.
get_ninja
()
self
.
debug
=
True
if
config
.
debug
else
False
self
.
debug_info
=
True
if
config
.
debug_info
else
False
self
.
no_samples_build
=
True
if
config
.
no_samples_build
else
False
def
get_cmake
(
self
):
if
not
self
.
config
.
use_android_buildtools
and
check_executable
([
'cmake'
,
'--version'
]):
...
...
@@ -217,7 +218,7 @@ class Builder:
BUILD_TESTS
=
"OFF"
,
BUILD_PERF_TESTS
=
"OFF"
,
BUILD_DOCS
=
"OFF"
,
BUILD_ANDROID_EXAMPLES
=
"ON"
,
BUILD_ANDROID_EXAMPLES
=
(
"OFF"
if
self
.
no_samples_build
else
"ON"
)
,
INSTALL_ANDROID_EXAMPLES
=
"ON"
,
)
if
self
.
ninja_path
!=
'ninja'
:
...
...
@@ -243,8 +244,11 @@ class Builder:
execute
(
cmd
)
# full parallelism for C++ compilation tasks
execute
([
self
.
ninja_path
,
"opencv_modules"
])
# limit parallelism for Gradle steps (avoid huge memory consumption)
execute
([
self
.
ninja_path
,
'-j3'
,
"install"
if
(
self
.
debug_info
or
self
.
debug
)
else
"install/strip"
])
# limit parallelism for building samples (avoid huge memory consumption)
if
self
.
no_samples_build
:
execute
([
self
.
ninja_path
,
"install"
if
(
self
.
debug_info
or
self
.
debug
)
else
"install/strip"
])
else
:
execute
([
self
.
ninja_path
,
"-j1"
if
(
self
.
debug_info
or
self
.
debug
)
else
"-j3"
,
"install"
if
(
self
.
debug_info
or
self
.
debug
)
else
"install/strip"
])
def
build_javadoc
(
self
):
classpaths
=
[]
...
...
@@ -323,6 +327,7 @@ if __name__ == "__main__":
parser
.
add_argument
(
'--force_opencv_toolchain'
,
action
=
"store_true"
,
help
=
"Do not use toolchain from Android NDK"
)
parser
.
add_argument
(
'--debug'
,
action
=
"store_true"
,
help
=
"Build 'Debug' binaries (CMAKE_BUILD_TYPE=Debug)"
)
parser
.
add_argument
(
'--debug_info'
,
action
=
"store_true"
,
help
=
"Build with debug information (useful for Release mode: BUILD_WITH_DEBUG_INFO=ON)"
)
parser
.
add_argument
(
'--no_samples_build'
,
action
=
"store_true"
,
help
=
"Do not build samples (speeds up build)"
)
args
=
parser
.
parse_args
()
log
.
basicConfig
(
format
=
'%(message)s'
,
level
=
log
.
DEBUG
)
...
...
platforms/android/gradle-wrapper/gradle.properties
浏览文件 @
a897fc91
...
...
@@ -9,7 +9,7 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs
=
-Xmx
1536m
org.gradle.jvmargs
=
-Xmx
2g
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
...
...
samples/CMakeLists.txt
浏览文件 @
a897fc91
...
...
@@ -38,7 +38,7 @@ endif()
if
(
UNIX AND NOT ANDROID
AND
(
HAVE_VA OR HAVE_VA_INTEL
))
add_subdirectory
(
va_intel
)
endif
()
if
(
ANDROID AND
BUILD_ANDROID_EXAMPLES
)
if
(
ANDROID
AND
(
BUILD_ANDROID_EXAMPLES OR INSTALL_ANDROID_EXAMPLES
)
)
add_subdirectory
(
android
)
endif
()
if
(
INSTALL_PYTHON_EXAMPLES
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录