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
e722cb96
Commit
e722cb96
authored
Jun 17, 2011
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added cmake file to compile Android native camera wrapper if Android source tree is available
parent
4f86b30a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
6 deletions
+68
-6
CMakeLists.txt
CMakeLists.txt
+20
-1
CMakeLists.txt
modules/androidcamera/CMakeLists.txt
+6
-4
CMakeLists.txt
modules/androidcamera/camera_wrapper/CMakeLists.txt
+41
-0
camera_wrapper.cpp
modules/androidcamera/camera_wrapper/camera_wrapper.cpp
+1
-1
No files found.
CMakeLists.txt
View file @
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
View file @
e722cb96
...
...
@@ -37,9 +37,10 @@ IF (NOT BUILD_SHARED_LIBS)
)
ENDIF
()
file
(
GLOB camera_wrappers
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../3rdparty/lib/libnative_camera_r*.so"
)
if
(
NOT BUILD_ANDROID_CAMERA_WRAPPER
)
file
(
GLOB camera_wrappers
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../3rdparty/lib/libnative_camera_r*.so"
)
foreach
(
wrapper
${
camera_wrappers
}
)
foreach
(
wrapper
${
camera_wrappers
}
)
ADD_CUSTOM_COMMAND
(
TARGET
${
the_target
}
POST_BUILD
...
...
@@ -49,4 +50,5 @@ foreach(wrapper ${camera_wrappers})
install
(
FILES
"
${
LIBRARY_OUTPUT_PATH
}
/
${
wrapper_name
}
"
DESTINATION lib
COMPONENT main
)
endforeach
()
\ No newline at end of file
endforeach
()
endif
()
\ No newline at end of file
modules/androidcamera/camera_wrapper/CMakeLists.txt
0 → 100644
View file @
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
View file @
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
;
...
...
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