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
f8e42721
Commit
f8e42721
authored
Jul 01, 2011
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HelloAndroid sample is moved to samples/android
parent
e0055707
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
24 deletions
+22
-24
cmake_android_armeabi.sh
android/scripts/cmake_android_armeabi.sh
+1
-1
CMakeLists.txt
samples/android/CMakeLists.txt
+8
-0
CMakeLists.txt
samples/android/hello-android/CMakeLists.txt
+2
-3
cmake_android.cmd
samples/android/hello-android/cmake_android.cmd
+3
-4
cmake_android.sh
samples/android/hello-android/cmake_android.sh
+1
-1
main.cpp
samples/android/hello-android/main.cpp
+0
-0
run.cmd
samples/android/hello-android/run.cmd
+4
-10
run.sh
samples/android/hello-android/run.sh
+3
-5
No files found.
android/scripts/cmake_android_armeabi.sh
View file @
f8e42721
...
...
@@ -4,5 +4,5 @@ cd `dirname $0`/..
mkdir
-p
build_armeabi
cd
build_armeabi
cmake
-C
../CMakeCache.android.initial.cmake
-DARM_TARGET
=
armeabi
-DCMAKE_TOOLCHAIN_FILE
=
../android.toolchain.cmake ../..
cmake
-C
../CMakeCache.android.initial.cmake
-DARM_TARGET
=
armeabi
-DCMAKE_TOOLCHAIN_FILE
=
../android.toolchain.cmake
$@
../..
samples/android/CMakeLists.txt
View file @
f8e42721
...
...
@@ -85,6 +85,7 @@ if (BUILD_EXAMPLES)
endmacro()
file(GLOB android_samples RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
*)
list(REMOVE_ITEM android_samples hello-android)
list(SORT android_samples)
foreach(sample
${
android_samples
}
)
...
...
@@ -93,5 +94,12 @@ if (BUILD_EXAMPLES)
endif()
endforeach()
#hello-android sample
ADD_EXECUTABLE( hello-android hello-android/main.cpp )
ADD_DEPENDENCIES(hello-android
${
sample_dependencies
}
)
TARGET_LINK_LIBRARIES(hello-android
${
OPENCV_LINKER_LIBS
}
${
sample_dependencies
}
)
set_target_properties(hello-android PROPERTIES OUTPUT_NAME hello-android RUNTIME_OUTPUT_DIRECTORY "
${
EXECUTABLE_OUTPUT_PATH
}
")
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "
${
additional_clean_files
}
")
endif()
android/apps/HelloA
ndroid/CMakeLists.txt
→
samples/android/hello-a
ndroid/CMakeLists.txt
View file @
f8e42721
...
...
@@ -8,7 +8,7 @@ IF( NOT PROJECT_NAME )
IF
(
NOT
"x$ENV{PROJECT_NAME}"
STREQUAL
"x"
)
SET
(
PROJECT_NAME $ENV{PROJECT_NAME}
)
ELSE
()
SET
(
PROJECT_NAME
HelloA
ndroid
)
SET
(
PROJECT_NAME
hello-a
ndroid
)
ENDIF
()
ENDIF
()
SET
(
PROJECT_NAME
${
PROJECT_NAME
}
CACHE STRING
"The name of your project"
)
...
...
@@ -19,7 +19,6 @@ PROJECT( ${PROJECT_NAME} )
# Find OpenCV
#########################################################
SET
(
OpenCV_DIR
${
CMAKE_SOURCE_DIR
}
/../../build CACHE PATH
"The path where you built opencv for android"
)
FIND_PACKAGE
(
OpenCV REQUIRED
)
#########################################################
...
...
@@ -55,7 +54,7 @@ message( STATUS "")
message
(
STATUS
"General configuration for
${
PROJECT_NAME
}
====================================="
)
message
(
STATUS
""
)
message
(
STATUS
" OpenCV path:
${
OpenCV_DIR
}
"
)
message
(
STATUS
" Compiler:
${
CMAKE_COMPILER
}
"
)
message
(
STATUS
" Compiler:
${
CMAKE_C
XX_C
OMPILER
}
"
)
message
(
STATUS
" C++ flags (Release):
${
CMAKE_CXX_FLAGS
}
${
CMAKE_CXX_FLAGS_RELEASE
}
"
)
message
(
STATUS
" C++ flags (Debug):
${
CMAKE_CXX_FLAGS
}
${
CMAKE_CXX_FLAGS_DEBUG
}
"
)
if
(
WIN32
)
...
...
android/apps/HelloA
ndroid/cmake_android.cmd
→
samples/android/hello-a
ndroid/cmake_android.cmd
View file @
f8e42721
@ECHO OFF
SETLOCAL
PUSHD %~dp0
SET PROJECT_NAME=
HelloA
ndroid
SET PROJECT_NAME=
hello-a
ndroid
SET BUILD_DIR=build_armeabi
SET ARM_TARGET=armeabi
CALL ..\..\scripts\build.cmd %*
CALL ..\..\
..\android\
scripts\build.cmd %*
POPD
ENDLOCAL
\ No newline at end of file
ENDLOCAL
android/apps/HelloA
ndroid/cmake_android.sh
→
samples/android/hello-a
ndroid/cmake_android.sh
View file @
f8e42721
...
...
@@ -2,7 +2,7 @@
cd
`
dirname
$0
`
BUILD_DIR
=
build_armeabi
opencv_android
=
`
pwd
`
/../..
opencv_android
=
`
pwd
`
/../..
/../android
opencv_build_dir
=
$opencv_android
/
$BUILD_DIR
mkdir
-p
$BUILD_DIR
...
...
android/apps/HelloA
ndroid/main.cpp
→
samples/android/hello-a
ndroid/main.cpp
View file @
f8e42721
File moved
android/apps/HelloA
ndroid/run.cmd
→
samples/android/hello-a
ndroid/run.cmd
View file @
f8e42721
...
...
@@ -15,12 +15,10 @@ SETLOCAL ENABLEEXTENSIONS || (ECHO Unable to enable command extensions. & EXIT \
PUSHD %~dp0
:: project specific settings
SET PROJECT_NAME=HelloAndroid
SET BUILD_DIR=build_armeabi
SET ARM_TARGET=armeabi
SET PROJECT_NAME=hello-android
:: try to load config file
SET CFG_PATH=..\..\scripts\wincfg.cmd
SET CFG_PATH=..\..\
..\android\
scripts\wincfg.cmd
IF EXIST %CFG_PATH% CALL %CFG_PATH%
:: check if sdk path defined
...
...
@@ -28,11 +26,8 @@ IF NOT DEFINED ANDROID_SDK (ECHO. & ECHO You should set an environment variable
(PUSHD "%ANDROID_SDK%" 2>NUL && POPD) || (ECHO. & ECHO Directory "%ANDROID_SDK%" specified by ANDROID_SDK variable does not exist & GOTO end)
SET adb=%ANDROID_SDK%\platform-tools\adb.exe
::binary output path is different for emulator build
IF "%ARM_TARGET%"=="armeabi" (SET OUT_DIR=armeabi) ELSE (SET OUT_DIR=armeabi-v7a)
:: copy file to device (usually takes 10 seconds or more)
%adb% push .\bin\%
OUT_DIR%\%
PROJECT_NAME% /data/bin/sample/%PROJECT_NAME% || GOTO end
%adb% push .\bin\%PROJECT_NAME% /data/bin/sample/%PROJECT_NAME% || GOTO end
:: set execute permission
%adb% shell chmod 777 /data/bin/sample/%PROJECT_NAME% || GOTO end
...
...
@@ -51,4 +46,4 @@ GOTO end
:end
POPD
ENDLOCAL
\ No newline at end of file
ENDLOCAL
android/apps/HelloA
ndroid/run.sh
→
samples/android/hello-a
ndroid/run.sh
View file @
f8e42721
#!/bin/sh
cd
`
dirname
$0
`
PROJECT_NAME
=
HelloAndroid
OUT_DIR
=
armeabi
PROJECT_NAME
=
hello-android
# copy file to device (usually takes 10 seconds or more)
adb push ./bin/
$
OUT_DIR
/
$
PROJECT_NAME
/data/bin/sample/
$PROJECT_NAME
||
return
adb push ./bin/
$PROJECT_NAME
/data/bin/sample/
$PROJECT_NAME
||
return
# set execute permission
adb shell
chmod
777 /data/bin/sample/
$PROJECT_NAME
||
return
...
...
@@ -13,4 +12,4 @@ adb shell chmod 777 /data/bin/sample/$PROJECT_NAME || return
adb shell /data/bin/sample/
$PROJECT_NAME
||
return
# get image result from device
adb pull /mnt/sdcard/HelloAndroid.png
||
return
\ No newline at end of file
adb pull /mnt/sdcard/HelloAndroid.png
||
return
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