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
9966903a
Commit
9966903a
authored
Jan 03, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake(android): fix non-idempotent INSTALL scripts
parent
f5862dac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
OpenCVDetectAndroidSDK.cmake
cmake/OpenCVDetectAndroidSDK.cmake
+20
-7
No files found.
cmake/OpenCVDetectAndroidSDK.cmake
View file @
9966903a
...
...
@@ -348,9 +348,18 @@ macro(add_android_project target path)
# put the final .apk to the OpenCV's bin folder
add_custom_command
(
TARGET
${
target
}
POST_BUILD COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
"
${
android_proj_bin_dir
}
/bin/
${
target
}
-debug.apk"
"
${
OpenCV_BINARY_DIR
}
/bin/
${
target
}
.apk"
)
if
(
INSTALL_ANDROID_EXAMPLES AND
"
${
target
}
"
MATCHES
"^example-"
)
#apk
install
(
FILES
"
${
OpenCV_BINARY_DIR
}
/bin/
${
target
}
.apk"
DESTINATION
"samples"
COMPONENT samples
)
get_filename_component
(
sample_dir
"
${
path
}
"
NAME
)
# apk
install
(
FILES
"
${
OpenCV_BINARY_DIR
}
/bin/
${
target
}
.apk"
DESTINATION
"samples"
COMPONENT samples
)
# clear "external" project files (need to remove files generated by 'android' tool)
set
(
external_target_files
${
ANDROID_PROJECT_FILES
}
)
ocv_list_add_prefix
(
external_target_files
"
\$
ENV{DESTDIR}
\$
{CMAKE_INSTALL_PREFIX}/samples/
${
sample_dir
}
/"
)
install
(
CODE
"
MESSAGE(STATUS
\"
Cleaning generated project files from Android sample install directory:
${
sample_dir
}
\"
)
FOREACH(f
${
ANDROID_PROJECT_FILES
}
)
FILE(REMOVE
\"\$
ENV{DESTDIR}
\$
{CMAKE_INSTALL_PREFIX}/samples/
${
sample_dir
}
/
\$
{f}
\"
)
ENDFOREACH()
"
COMPONENT samples
)
#java part
list
(
REMOVE_ITEM android_proj_files
${
ANDROID_MANIFEST_FILE
}
)
foreach
(
f
${
android_proj_files
}
${
ANDROID_MANIFEST_FILE
}
)
...
...
@@ -368,11 +377,15 @@ macro(add_android_project target path)
if
(
android_proj_lib_deps_commands
)
set
(
inst_lib_opt
" --library ../../sdk/java"
)
endif
()
install
(
CODE
"EXECUTE_PROCESS(COMMAND
${
ANDROID_EXECUTABLE
}
--silent update project --path . --target
\"
${
android_proj_sdk_target
}
\"
--name
\"
${
target
}
\"
${
inst_lib_opt
}
WORKING_DIRECTORY
\"\$
ENV{DESTDIR}
\$
{CMAKE_INSTALL_PREFIX}/samples/
${
sample_dir
}
\"
)"
COMPONENT samples
)
#empty 'gen'
install
(
CODE
"MAKE_DIRECTORY(
\"\$
ENV{DESTDIR}
\$
{CMAKE_INSTALL_PREFIX}/samples/
${
sample_dir
}
/gen
\"
)"
COMPONENT samples
)
install
(
CODE
"
MESSAGE(STATUS
\"
Fixing Android library reference for sample:
${
sample_dir
}
\"
)
EXECUTE_PROCESS(
COMMAND
${
ANDROID_EXECUTABLE
}
--silent update project --path . --target
\"
${
android_proj_sdk_target
}
\"
--name
\"
${
target
}
\"
${
inst_lib_opt
}
WORKING_DIRECTORY
\"\$
ENV{DESTDIR}
\$
{CMAKE_INSTALL_PREFIX}/samples/
${
sample_dir
}
\"
)
"
COMPONENT samples
)
# empty 'gen'
install
(
CODE
"FILE(MAKE_DIRECTORY
\"\$
ENV{DESTDIR}
\$
{CMAKE_INSTALL_PREFIX}/samples/
${
sample_dir
}
/gen
\"
)"
COMPONENT samples
)
endif
()
endif
()
endmacro
()
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