Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
e722cb96
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,发现更多精彩内容 >>
提交
e722cb96
编写于
6月 17, 2011
作者:
A
Andrey Kamaev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added cmake file to compile Android native camera wrapper if Android source tree is available
上级
4f86b30a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
77 addition
and
16 deletion
+77
-16
CMakeLists.txt
CMakeLists.txt
+20
-1
modules/androidcamera/CMakeLists.txt
modules/androidcamera/CMakeLists.txt
+16
-14
modules/androidcamera/camera_wrapper/CMakeLists.txt
modules/androidcamera/camera_wrapper/CMakeLists.txt
+40
-0
modules/androidcamera/camera_wrapper/camera_wrapper.cpp
modules/androidcamera/camera_wrapper/camera_wrapper.cpp
+1
-1
未找到文件。
CMakeLists.txt
浏览文件 @
e722cb96
...
...
@@ -863,6 +863,21 @@ if(WIN32)
endif
()
############## Android source tree for native camera ###############
if
(
ANDROID
)
SET
(
ANDROID_SOURCE_TREE
"ANDROID_SOURCE_TREE-NOTFOUND"
CACHE PATH
"Path to Android source tree.
Set this variable to path to your Android sources to compile
libnative_camera_rx.x.x.so for your Android"
)
SET
(
BUILD_ANDROID_CAMERA_WRAPPER OFF
)
if
(
ANDROID_SOURCE_TREE
)
FILE
(
STRINGS
"
${
ANDROID_SOURCE_TREE
}
/development/sdk/platform_source.properties"
ANDROID_VERSION REGEX
"Platform
\\
.Version=[0-9]+
\\
.[0-9]+
\\
.[0-9]+"
)
string
(
REGEX REPLACE
"Platform
\\
.Version=([0-9]+
\\
.[0-9]+
\\
.[0-9]+)"
"
\\
1"
ANDROID_VERSION
"
${
ANDROID_VERSION
}
"
)
if
(
NOT
"
${
ANDROID_VERSION
}
"
STREQUAL
""
)
SET
(
BUILD_ANDROID_CAMERA_WRAPPER ON
)
endif
()
endif
()
endif
()
################## Reference Manual ##################
set
(
BUILD_DOCS ON CACHE BOOL
"Build OpenCV Reference Manual"
)
...
...
@@ -1460,7 +1475,11 @@ message(STATUS " V4L/V4L2: ${HAVE_CAMV4L}/${HAVE_CAMV4L2}")
endif
()
message
(
STATUS
" Xine:
${
HAVE_XINE
}
"
)
if
(
ANDROID
)
message
(
STATUS
" AndroidNativeCamera: build"
)
if
(
BUILD_ANDROID_CAMERA_WRAPPER
)
message
(
STATUS
" AndroidNativeCamera: build for Android
${
ANDROID_VERSION
}
"
)
else
()
message
(
STATUS
" AndroidNativeCamera: use prebuilt libraries"
)
endif
(
BUILD_ANDROID_CAMERA_WRAPPER
)
endif
()
endif
()
#if(UNIX AND NOT APPLE)
...
...
modules/androidcamera/CMakeLists.txt
浏览文件 @
e722cb96
...
...
@@ -16,7 +16,7 @@ SET( the_target opencv_androidcamera )
ADD_LIBRARY
(
${
the_target
}
STATIC src/camera_activity.cpp
)
if
(
BUILD_SHARED_LIBS
)
add_definitions
(
-DCVAPI_EXPORTS
)
add_definitions
(
-DCVAPI_EXPORTS
)
endif
()
TARGET_LINK_LIBRARIES
(
${
the_target
}
${
LIBRARY_DEPS
}
)
...
...
@@ -37,16 +37,18 @@ IF (NOT BUILD_SHARED_LIBS)
)
ENDIF
()
file
(
GLOB camera_wrappers
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../3rdparty/lib/libnative_camera_r*.so"
)
foreach
(
wrapper
${
camera_wrappers
}
)
ADD_CUSTOM_COMMAND
(
TARGET
${
the_target
}
POST_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
wrapper
}
"
"
${
LIBRARY_OUTPUT_PATH
}
"
)
get_filename_component
(
wrapper_name
"
${
wrapper
}
"
NAME
)
install
(
FILES
"
${
LIBRARY_OUTPUT_PATH
}
/
${
wrapper_name
}
"
DESTINATION lib
COMPONENT main
)
endforeach
()
\ No newline at end of file
if
(
NOT BUILD_ANDROID_CAMERA_WRAPPER
)
file
(
GLOB camera_wrappers
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../3rdparty/lib/libnative_camera_r*.so"
)
foreach
(
wrapper
${
camera_wrappers
}
)
ADD_CUSTOM_COMMAND
(
TARGET
${
the_target
}
POST_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
wrapper
}
"
"
${
LIBRARY_OUTPUT_PATH
}
"
)
get_filename_component
(
wrapper_name
"
${
wrapper
}
"
NAME
)
install
(
FILES
"
${
LIBRARY_OUTPUT_PATH
}
/
${
wrapper_name
}
"
DESTINATION lib
COMPONENT main
)
endforeach
()
endif
()
\ No newline at end of file
modules/androidcamera/camera_wrapper/CMakeLists.txt
0 → 100644
浏览文件 @
e722cb96
SET
(
the_target native_camera_r
${
ANDROID_VERSION
}
)
project
(
${
the_target
}
)
link_directories
(
"
${
ANDROID_SOURCE_TREE
}
/out/target/product/generic/system/lib"
)
INCLUDE_DIRECTORIES
(
${
ANDROID_SOURCE_TREE
}
${
ANDROID_SOURCE_TREE
}
/frameworks/base/include/ui
${
ANDROID_SOURCE_TREE
}
/frameworks/base/include/surfaceflinger
${
ANDROID_SOURCE_TREE
}
/frameworks/base/include/camera
${
ANDROID_SOURCE_TREE
}
/frameworks/base/include/media
${
ANDROID_SOURCE_TREE
}
/frameworks/base/include/camera
${
ANDROID_SOURCE_TREE
}
/frameworks/base/include
${
ANDROID_SOURCE_TREE
}
/system/core/include
${
ANDROID_SOURCE_TREE
}
/hardware/libhardware/include
${
ANDROID_SOURCE_TREE
}
/frameworks/base/native/include
)
SET
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-fno-rtti -fno-exceptions"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fno-rtti -fno-exceptions"
)
ADD_LIBRARY
(
${
the_target
}
MODULE camera_wrapper.h camera_wrapper.cpp
)
string
(
REGEX REPLACE
"[.]"
"_"
LIBRARY_DEF
${
ANDROID_VERSION
}
)
add_definitions
(
-DANDROID_r
${
LIBRARY_DEF
}
)
target_link_libraries
(
${
the_target
}
dl m stdc++ utils camera_client ui media binder cutils surfaceflinger_client supc++ log
)
SET_TARGET_PROPERTIES
(
${
the_target
}
PROPERTIES
OUTPUT_NAME
"
${
the_target
}
"
ARCHIVE_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
RUNTIME_OUTPUT_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
)
install
(
TARGETS
${
the_target
}
RUNTIME DESTINATION bin COMPONENT main
ARCHIVE DESTINATION lib COMPONENT main
LIBRARY DESTINATION lib COMPONENT main
)
\ No newline at end of file
modules/androidcamera/camera_wrapper/camera_wrapper.cpp
浏览文件 @
e722cb96
...
...
@@ -6,7 +6,7 @@
#include <camera/CameraHardwareInterface.h>
#include "camera_wrapper.h"
#include "../
camera_wrapper_connector
/camera_properties.h"
#include "../
include
/camera_properties.h"
#include <string>
using
namespace
android
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录