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
65cb53aa
Commit
65cb53aa
authored
Jul 04, 2011
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Android tests and samples build
parent
6d549490
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
CMakeLists.txt
modules/java/CMakeLists.txt
+8
-7
CMakeLists.txt
samples/android/CMakeLists.txt
+6
-3
No files found.
modules/java/CMakeLists.txt
View file @
65cb53aa
...
...
@@ -138,8 +138,11 @@ endforeach()
#android test project
if
(
ANDROID AND BUILD_TESTS AND CAN_BUILD_ANDROID_PROJECTS
)
SET
(
test_dir
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/android_test"
)
SET
(
test_target OpenCV_JavaAPI_Tests
)
file
(
COPY android_test DESTINATION
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
PATTERN
".svn"
EXCLUDE
)
SET
(
test_dir
"
${
CMAKE_CURRENT_BINARY_DIR
}
/android_test"
)
SET
(
test_name opencv_test_java
)
SET
(
test_target
${
test_name
}
_android
)
add_custom_target
(
${
test_target
}
ALL
)
add_dependencies
(
${
test_target
}
opencv_java opencv_java_api
)
...
...
@@ -151,14 +154,12 @@ if(ANDROID AND BUILD_TESTS AND CAN_BUILD_ANDROID_PROJECTS)
WORKING_DIRECTORY
${
test_dir
}
COMMAND
${
CMAKE_COMMAND
}
-E remove -f
"
${
test_dir
}
/default.properties"
COMMAND
${
CMAKE_COMMAND
}
-E touch
"
${
test_dir
}
/default.properties"
COMMAND
${
ANDROID_EXECUTABLE
}
update project --name
"
${
test_
target
}
"
--target android-8 --library
"
${
OPENCV_REFERENCE_PATH
}
"
--path .
COMMAND
${
ANDROID_EXECUTABLE
}
update project --name
"
${
test_
name
}
"
--target android-8 --library
"
${
OPENCV_REFERENCE_PATH
}
"
--path .
COMMAND
${
ANT_EXECUTABLE
}
debug
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
test_dir
}
/bin/
${
test_
target
}
-debug.apk"
"
${
CMAKE_BINARY_DIR
}
/bin/
${
test_target
}
-debug
.apk"
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
test_dir
}
/bin/
${
test_
name
}
-debug.apk"
"
${
CMAKE_BINARY_DIR
}
/bin/
${
test_name
}
.apk"
)
LIST
(
APPEND additional_clean_files
"
${
CMAKE_BINARY_DIR
}
/bin/
${
test_target
}
-debug.apk"
"
${
test_dir
}
/build.xml"
"
${
test_dir
}
/local.properties"
"
${
test_dir
}
/proguard.cfg"
)
LIST
(
APPEND additional_clean_files
"
${
CMAKE_BINARY_DIR
}
/bin/
${
test_name
}
.apk"
"
${
test_dir
}
/build.xml"
"
${
test_dir
}
/local.properties"
"
${
test_dir
}
/proguard.cfg"
)
endif
()
set_directory_properties
(
PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"
${
additional_clean_files
}
"
)
samples/android/CMakeLists.txt
View file @
65cb53aa
...
...
@@ -29,7 +29,8 @@ if (BUILD_EXAMPLES)
macro
(
ADD_ANDROID_SAMPLE sample_name
)
#message(STATUS "Build android sample: '${sample_name}'")
SET
(
sample_dir
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
sample
}
"
)
#SET(sample_dir "${CMAKE_CURRENT_SOURCE_DIR}/${sample}")
SET
(
sample_dir
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
sample
}
"
)
add_custom_target
(
${
sample
}
ALL
)
add_dependencies
(
${
sample
}
opencv_java opencv_java_api
)
...
...
@@ -52,10 +53,10 @@ if (BUILD_EXAMPLES)
COMMAND
${
CMAKE_COMMAND
}
-E touch "
${
sample_dir
}
/default.properties
"
COMMAND
${
ANDROID_EXECUTABLE
}
update project --name "
${
sample
}
" --target android-8
${
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
"
COMMAND
${
CMAKE_COMMAND
}
-E copy "
${
sample_dir
}
/bin/
${
sample
}
-debug.apk
" "
${
CMAKE_BINARY_DIR
}
/bin/
${
sample
}
.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
")
LIST(APPEND additional_clean_files "
${
CMAKE_BINARY_DIR
}
/bin/
${
sample
}
.apk
" "
${
sample_dir
}
/build.xml
" "
${
sample_dir
}
/local.properties
" "
${
sample_dir
}
/proguard.cfg
")
if(IS_DIRECTORY "
${
sample_dir
}
/jni
")
INCLUDE_DIRECTORIES("
${
sample_dir
}
/jni
")
...
...
@@ -87,6 +88,8 @@ if (BUILD_EXAMPLES)
file(GLOB android_samples RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
*)
list(REMOVE_ITEM android_samples hello-android)
list(SORT android_samples)
file(COPY
${
android_samples
}
DESTINATION "
${
CMAKE_CURRENT_BINARY_DIR
}
" PATTERN "
.svn
" EXCLUDE)
foreach(sample
${
android_samples
}
)
if(EXISTS
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
sample
}
/AndroidManifest.xml)
...
...
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