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
47dea29e
Commit
47dea29e
authored
Mar 16, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11081 from alalek:cmake_fix_android_examples_dependencies
parents
41f8e788
1e808a49
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
15 deletions
+16
-15
OpenCVDetectAndroidSDK.cmake
cmake/OpenCVDetectAndroidSDK.cmake
+15
-14
copy_files.cmake
cmake/copy_files.cmake
+1
-1
No files found.
cmake/OpenCVDetectAndroidSDK.cmake
View file @
47dea29e
...
@@ -302,18 +302,6 @@ macro(add_android_project target path)
...
@@ -302,18 +302,6 @@ macro(add_android_project target path)
else
()
else
()
list
(
APPEND android_proj_extra_deps opencv_java_android
)
list
(
APPEND android_proj_extra_deps opencv_java_android
)
endif
()
endif
()
add_custom_command
(
OUTPUT
"
${
android_proj_bin_dir
}
/bin/
${
target
}
-debug.apk"
COMMAND
${
ANT_EXECUTABLE
}
-q -noinput -k debug -Djava.target=1.6 -Djava.source=1.6
COMMAND
${
CMAKE_COMMAND
}
-E touch
"
${
android_proj_bin_dir
}
/bin/
${
target
}
-debug.apk"
# needed because ant does not update the timestamp of updated apk
WORKING_DIRECTORY
"
${
android_proj_bin_dir
}
"
DEPENDS
${
android_proj_extra_deps
}
${
android_proj_file_deps
}
${
JNI_LIB_NAME
}
COMMENT
"Generating
${
target
}
-debug.apk"
)
unset
(
JNI_LIB_NAME
)
add_custom_target
(
${
target
}
ALL SOURCES
"
${
android_proj_bin_dir
}
/bin/
${
target
}
-debug.apk"
)
set
(
_native_deps
""
)
set
(
_native_deps
""
)
if
(
NOT android_proj_IGNORE_JAVA
)
if
(
NOT android_proj_IGNORE_JAVA
)
...
@@ -323,7 +311,7 @@ macro(add_android_project target path)
...
@@ -323,7 +311,7 @@ macro(add_android_project target path)
list
(
APPEND _native_deps
${
android_proj_native_deps
}
)
list
(
APPEND _native_deps
${
android_proj_native_deps
}
)
endif
()
endif
()
if
(
_native_deps
)
if
(
_native_deps
)
add_dependencies
(
${
target
}
${
_native_deps
}
)
list
(
APPEND android_proj_extra_deps
${
_native_deps
}
)
endif
()
endif
()
if
((
android_proj_COPY_LIBS OR ANDROID_EXAMPLES_WITH_LIBS
)
AND _native_deps
)
if
((
android_proj_COPY_LIBS OR ANDROID_EXAMPLES_WITH_LIBS
)
AND _native_deps
)
...
@@ -332,9 +320,22 @@ macro(add_android_project target path)
...
@@ -332,9 +320,22 @@ macro(add_android_project target path)
ocv_copyfiles_append_dir
(
NATIVE_COPY
"
${
OpenCV_BINARY_DIR
}
/lib"
"
${
android_proj_bin_dir
}
/libs"
"
${
OpenCV_BINARY_DIR
}
/lib/*.so"
)
ocv_copyfiles_append_dir
(
NATIVE_COPY
"
${
OpenCV_BINARY_DIR
}
/lib"
"
${
android_proj_bin_dir
}
/libs"
"
${
OpenCV_BINARY_DIR
}
/lib/*.so"
)
ocv_copyfiles_add_target
(
${
target
}
_copy_libs NATIVE_COPY
"Copy native libs for project:
${
target
}
"
${
_native_deps
}
)
ocv_copyfiles_add_target
(
${
target
}
_copy_libs NATIVE_COPY
"Copy native libs for project:
${
target
}
"
${
_native_deps
}
)
add_dependencies
(
${
target
}
${
target
}
_copy_libs
)
list
(
APPEND android_proj_extra_deps
${
target
}
_copy_libs
)
endif
()
endif
()
add_custom_command
(
OUTPUT
"
${
android_proj_bin_dir
}
/bin/
${
target
}
-debug.apk"
COMMAND
${
ANT_EXECUTABLE
}
-q -noinput -k debug -Djava.target=1.6 -Djava.source=1.6
COMMAND
${
CMAKE_COMMAND
}
-E touch
"
${
android_proj_bin_dir
}
/bin/
${
target
}
-debug.apk"
# needed because ant does not update the timestamp of updated apk
WORKING_DIRECTORY
"
${
android_proj_bin_dir
}
"
DEPENDS
${
android_proj_extra_deps
}
${
android_proj_file_deps
}
${
JNI_LIB_NAME
}
COMMENT
"Generating
${
target
}
-debug.apk"
)
unset
(
JNI_LIB_NAME
)
add_custom_target
(
${
target
}
ALL SOURCES
"
${
android_proj_bin_dir
}
/bin/
${
target
}
-debug.apk"
)
# There is some strange problem with concurrent Android .APK builds:
# There is some strange problem with concurrent Android .APK builds:
# <android-sdk>/tools/ant/build.xml:781: Problem reading <build_dir>/bin/classes.jar'
# <android-sdk>/tools/ant/build.xml:781: Problem reading <build_dir>/bin/classes.jar'
if
(
__android_project_chain
)
if
(
__android_project_chain
)
...
...
cmake/copy_files.cmake
View file @
47dea29e
...
@@ -25,7 +25,7 @@ macro(copy_file_ src dst prefix)
...
@@ -25,7 +25,7 @@ macro(copy_file_ src dst prefix)
endif
()
endif
()
get_filename_component
(
target_path
"
${
dst
}
"
PATH
)
get_filename_component
(
target_path
"
${
dst
}
"
PATH
)
file
(
MAKE_DIRECTORY
"
${
target_path
}
"
)
file
(
MAKE_DIRECTORY
"
${
target_path
}
"
)
execute_process
(
COMMAND
${
CMAKE_COMMAND
}
-E create_symlink
${
src
}
${
dst
}
execute_process
(
COMMAND
${
CMAKE_COMMAND
}
-E create_symlink
"
${
src
}
"
"
${
dst
}
"
RESULT_VARIABLE SYMLINK_RESULT
)
RESULT_VARIABLE SYMLINK_RESULT
)
if
(
NOT SYMLINK_RESULT EQUAL 0
)
if
(
NOT SYMLINK_RESULT EQUAL 0
)
#message("Symlink failed, fallback to 'copy'")
#message("Symlink failed, fallback to 'copy'")
...
...
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