mirror of https://github.com/opencv/opencv.git
parent
3b5b20b795
commit
e72a23243b
33 changed files with 313 additions and 272 deletions
@ -1,147 +1,130 @@ |
||||
# creates target "${_target}_android_project" for building standard Android project |
||||
macro(add_android_project _target _path) |
||||
SET(android_dependencies opencv_contrib opencv_legacy opencv_objdetect opencv_calib3d opencv_features2d opencv_video opencv_highgui opencv_ml opencv_imgproc opencv_flann opencv_core) |
||||
if(NOT BUILD_SHARED_LIBS) |
||||
if(BUILD_FAT_JAVA_LIB) |
||||
SET(android_dependencies opencv_java) |
||||
else() |
||||
LIST(APPEND android_dependencies opencv_androidcamera) |
||||
#add_android_project(target_name ${path} NATIVE_DEPS opencv_core LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11) |
||||
macro(add_android_project target path) |
||||
# parse arguments |
||||
set(android_proj_arglist NATIVE_DEPS LIBRARY_DEPS SDK_TARGET) |
||||
set(__varname "android_proj_") |
||||
foreach(v ${android_proj_arglist}) |
||||
set(${__varname}${v} "") |
||||
endforeach() |
||||
foreach(arg ${ARGN}) |
||||
set(__var "${__varname}") |
||||
foreach(v ${android_proj_arglist}) |
||||
if("${v}" STREQUAL "${arg}") |
||||
set(__varname "android_proj_${v}") |
||||
break() |
||||
endif() |
||||
endforeach() |
||||
if(__var STREQUAL __varname) |
||||
list(APPEND ${__var} "${arg}") |
||||
endif() |
||||
endforeach() |
||||
|
||||
# get compatible SDK target |
||||
android_get_compatible_target(android_proj_sdk_target ${ANDROID_NATIVE_API_LEVEL} ${android_proj_SDK_TARGET}) |
||||
|
||||
if(NOT android_proj_sdk_target) |
||||
message(WARNING "Can not find any SDK target compatible with: ${ANDROID_NATIVE_API_LEVEL} ${android_proj_SDK_TARGET} |
||||
The project ${target} will not be build") |
||||
endif() |
||||
|
||||
# check native dependencies |
||||
if(NATIVE_DEPS) |
||||
ocv_check_dependencies(${android_proj_NATIVE_DEPS}) |
||||
# warn? |
||||
else() |
||||
set(OCV_DEPENDENCIES_FOUND TRUE) |
||||
endif() |
||||
|
||||
if(OCV_DEPENDENCIES_FOUND AND android_proj_sdk_target AND ANDROID_EXECUTABLE AND ANT_EXECUTABLE AND ANDROID_TOOLS_Pkg_Revision GREATER 13 AND EXISTS "${path}/${ANDROID_MANIFEST_FILE}") |
||||
|
||||
project(${target}) |
||||
set(android_proj_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/.build") |
||||
|
||||
# get project sources |
||||
file(GLOB_RECURSE android_proj_files RELATIVE "${path}" "${path}/res/*" "${path}/src/*") |
||||
ocv_list_filterout(android_proj_files ".svn") |
||||
|
||||
# copy sources out from the build tree |
||||
set(android_proj_file_deps "") |
||||
foreach(f ${android_proj_files} ${ANDROID_MANIFEST_FILE}) |
||||
add_custom_command( |
||||
OUTPUT "${android_proj_bin_dir}/${f}" |
||||
COMMAND ${CMAKE_COMMAND} -E copy "${path}/${f}" "${android_proj_bin_dir}/${f}" |
||||
MAIN_DEPENDENCY "${path}/${f}" |
||||
COMMENT "Copying ${f}") |
||||
list(APPEND android_proj_file_deps "${path}/${f}" "${android_proj_bin_dir}/${f}") |
||||
endforeach() |
||||
|
||||
set(android_proj_lib_deps_commands "") |
||||
set(android_proj_target_files ${ANDROID_PROJECT_FILES}) |
||||
ocv_list_add_prefix(android_proj_target_files "${android_proj_bin_dir}/") |
||||
|
||||
# process Android library dependencies |
||||
foreach(dep ${android_proj_LIBRARY_DEPS}) |
||||
file(RELATIVE_PATH __dep "${android_proj_bin_dir}" "${dep}") |
||||
list(APPEND android_proj_lib_deps_commands |
||||
COMMAND ${ANDROID_EXECUTABLE} --silent update project --path "${android_proj_bin_dir}" --library "${__dep}") |
||||
endforeach() |
||||
|
||||
# fix Android project |
||||
add_custom_command( |
||||
OUTPUT ${android_proj_target_files} |
||||
COMMAND ${CMAKE_COMMAND} -E remove ${android_proj_target_files} |
||||
COMMAND ${ANDROID_EXECUTABLE} --silent update project --path "${android_proj_bin_dir}" --target "${android_proj_sdk_target}" --name "${target}" |
||||
${android_proj_lib_deps_commands} |
||||
MAIN_DEPENDENCY "${android_proj_bin_dir}/${ANDROID_MANIFEST_FILE}" |
||||
DEPENDS "${path}/${ANDROID_MANIFEST_FILE}" |
||||
COMMENT "Updating Android project at ${path}. SDK target: ${android_proj_sdk_target}" |
||||
) |
||||
|
||||
if (ANDROID AND CAN_BUILD_ANDROID_PROJECTS) |
||||
file(GLOB_RECURSE res_files_all RELATIVE "${_path}" "${_path}/res/*") |
||||
file(GLOB_RECURSE jni_files_all RELATIVE "${_path}" "${_path}/jni/*.c*" "${_path}/jni/*.h*") |
||||
file(GLOB_RECURSE src_files_all RELATIVE "${_path}" "${_path}/src/*.java") |
||||
|
||||
#remove .svn |
||||
set(res_files) |
||||
foreach(f ${res_files_all}) |
||||
if(NOT f MATCHES "\\.svn") |
||||
list(APPEND res_files "${f}") |
||||
endif() |
||||
endforeach() |
||||
set(jni_files) |
||||
foreach(f ${jni_files_all}) |
||||
if(NOT f MATCHES "\\.svn") |
||||
list(APPEND jni_files "${f}") |
||||
endif() |
||||
endforeach() |
||||
set(src_files) |
||||
foreach(f ${src_files_all}) |
||||
if(NOT f MATCHES "\\.svn") |
||||
list(APPEND src_files "${f}") |
||||
endif() |
||||
endforeach() |
||||
|
||||
# get temporary location for the project |
||||
file(RELATIVE_PATH build_path "${OpenCV_SOURCE_DIR}" "${_path}") |
||||
SET(build_path "${CMAKE_BINARY_DIR}/${build_path}") |
||||
|
||||
# copy project to temporary location |
||||
SET(${_target}_project_files) |
||||
foreach(f ${res_files} ${src_files} "AndroidManifest.xml") |
||||
if(NOT "${build_path}" STREQUAL "${_path}") |
||||
#this is not needed in case of in-source build |
||||
add_custom_command( |
||||
OUTPUT "${build_path}/${f}" |
||||
COMMAND ${CMAKE_COMMAND} -E copy "${_path}/${f}" "${build_path}/${f}" |
||||
DEPENDS "${_path}/${f}" |
||||
COMMENT "" |
||||
) |
||||
endif() |
||||
list(APPEND ${_target}_project_files "${build_path}/${f}") |
||||
endforeach() |
||||
|
||||
# process project.properties |
||||
file(STRINGS "${_path}/project.properties" project_properties REGEX "^android\\.library\\.reference\\.1=.+$") |
||||
if (project_properties) |
||||
# has opencv dependency |
||||
file(RELATIVE_PATH OPENCV_REFERENCE_PATH "${build_path}" "${CMAKE_BINARY_DIR}") |
||||
add_custom_command( |
||||
OUTPUT "${build_path}/project.properties" |
||||
OUTPUT "${build_path}/build.xml" |
||||
OUTPUT "${build_path}/local.properties" |
||||
OUTPUT "${build_path}/proguard.cfg" |
||||
COMMAND ${CMAKE_COMMAND} -E echo "" > "project.properties" |
||||
COMMAND ${ANDROID_EXECUTABLE} update project --name "${_target}" --target "${ANDROID_SDK_TARGET}" --library "${OPENCV_REFERENCE_PATH}" --path . |
||||
WORKING_DIRECTORY ${build_path} |
||||
DEPENDS ${${_target}_project_files} |
||||
DEPENDS "${CMAKE_BINARY_DIR}/project.properties" |
||||
DEPENDS "${CMAKE_BINARY_DIR}/AndroidManifest.xml" |
||||
COMMENT "Updating android project - ${_target}" |
||||
) |
||||
else() |
||||
# has no opencv dependency |
||||
add_custom_command( |
||||
OUTPUT "${build_path}/project.properties" |
||||
OUTPUT "${build_path}/build.xml" |
||||
OUTPUT "${build_path}/local.properties" |
||||
OUTPUT "${build_path}/proguard.cfg" |
||||
COMMAND ${CMAKE_COMMAND} -E echo "" > "project.properties" |
||||
COMMAND ${ANDROID_EXECUTABLE} update project --name "${_target}" --target "${ANDROID_SDK_TARGET}" --path . |
||||
WORKING_DIRECTORY ${build_path} |
||||
DEPENDS ${${_target}_project_files} |
||||
COMMENT "Updating android project - ${_target}" |
||||
) |
||||
endif() |
||||
|
||||
if("${build_path}" STREQUAL "${_path}") |
||||
#in case of in-source build project.properties file is not generated (it is just overwritten :) |
||||
SET_SOURCE_FILES_PROPERTIES("${build_path}/project.properties" PROPERTIES GENERATED FALSE) |
||||
endif() |
||||
|
||||
list(APPEND ${_target}_project_files "${build_path}/project.properties" "${build_path}/build.xml" "${build_path}/local.properties" "${build_path}/proguard.cfg") |
||||
|
||||
# build native part of android project |
||||
if(jni_files) |
||||
INCLUDE_DIRECTORIES("${_path}/jni") |
||||
|
||||
FILE(STRINGS "${_path}/jni/Android.mk" JNI_LIB_NAME REGEX "LOCAL_MODULE[ ]*:=[ ]*.*" ) |
||||
string(REGEX REPLACE "LOCAL_MODULE[ ]*:=[ ]*([a-zA-Z_][a-zA-Z_0-9]*)[ ]*" "\\1" JNI_LIB_NAME "${JNI_LIB_NAME}") |
||||
|
||||
SET(jni_sources) |
||||
foreach(src ${jni_files}) |
||||
list(APPEND jni_sources "${_path}/${src}") |
||||
endforeach() |
||||
|
||||
ADD_LIBRARY(${JNI_LIB_NAME} MODULE ${jni_sources}) |
||||
TARGET_LINK_LIBRARIES(${JNI_LIB_NAME} ${OPENCV_LINKER_LIBS} ${android_dependencies}) |
||||
|
||||
set_target_properties(${JNI_LIB_NAME} PROPERTIES |
||||
OUTPUT_NAME "${JNI_LIB_NAME}" |
||||
LIBRARY_OUTPUT_DIRECTORY "${build_path}/libs/${ANDROID_NDK_ABI_NAME}" |
||||
) |
||||
list(APPEND android_proj_file_deps ${android_proj_target_files}) |
||||
|
||||
ADD_CUSTOM_COMMAND( |
||||
TARGET ${JNI_LIB_NAME} |
||||
POST_BUILD |
||||
COMMAND ${CMAKE_STRIP} --strip-unneeded "${build_path}/libs/${ANDROID_NDK_ABI_NAME}/*.so" |
||||
) |
||||
else() |
||||
SET(JNI_LIB_NAME) |
||||
endif() |
||||
|
||||
add_custom_command( |
||||
OUTPUT "${build_path}/bin/${_target}-debug.apk" |
||||
OUTPUT "${CMAKE_BINARY_DIR}/bin/${_target}.apk" |
||||
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug |
||||
COMMAND ${CMAKE_COMMAND} -E copy "${build_path}/bin/${_target}-debug.apk" "${CMAKE_BINARY_DIR}/bin/${_target}.apk" |
||||
WORKING_DIRECTORY ${build_path} |
||||
DEPENDS ${${_target}_project_files} |
||||
DEPENDS "${LIBRARY_OUTPUT_PATH}/libopencv_java.so" |
||||
COMMENT "Generating bin/${_target}.apk" |
||||
) |
||||
# build native part |
||||
file(GLOB_RECURSE android_proj_jni_files "${path}/jni/*.c" "${path}/jni/*.h" "${path}/jni/*.cpp" "${path}/jni/*.hpp") |
||||
ocv_list_filterout(android_proj_jni_files ".svn") |
||||
|
||||
if(android_proj_jni_files AND EXISTS ${path}/jni/Android.mk) |
||||
file(STRINGS "${path}/jni/Android.mk" JNI_LIB_NAME REGEX "LOCAL_MODULE[ ]*:=[ ]*.*" ) |
||||
string(REGEX REPLACE "LOCAL_MODULE[ ]*:=[ ]*([a-zA-Z_][a-zA-Z_0-9]*)[ ]*" "\\1" JNI_LIB_NAME "${JNI_LIB_NAME}") |
||||
|
||||
if(JNI_LIB_NAME) |
||||
ocv_include_modules_recurse(${android_proj_NATIVE_DEPS}) |
||||
ocv_include_directories("${path}/jni") |
||||
|
||||
ADD_CUSTOM_TARGET(${_target}_android_project ALL |
||||
DEPENDS "${build_path}/bin/${_target}-debug.apk" |
||||
DEPENDS "${CMAKE_BINARY_DIR}/bin/${_target}.apk" |
||||
add_library(${JNI_LIB_NAME} MODULE ${android_proj_jni_files}) |
||||
target_link_libraries(${JNI_LIB_NAME} ${OPENCV_LINKER_LIBS} ${android_proj_NATIVE_DEPS}) |
||||
|
||||
set_target_properties(${JNI_LIB_NAME} PROPERTIES |
||||
OUTPUT_NAME "${JNI_LIB_NAME}" |
||||
LIBRARY_OUTPUT_DIRECTORY "${android_proj_bin_dir}/libs/${ANDROID_NDK_ABI_NAME}" |
||||
) |
||||
|
||||
add_dependencies(${_target}_android_project opencv_java ${JNI_LIB_NAME}) |
||||
get_target_property(android_proj_jni_location "${JNI_LIB_NAME}" LOCATION) |
||||
add_custom_command(TARGET ${JNI_LIB_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} --strip-unneeded "${android_proj_jni_location}") |
||||
endif() |
||||
else() |
||||
unset(JNI_LIB_NAME) |
||||
endif() |
||||
|
||||
if("${ARGN}" STREQUAL "INSTALL" AND INSTALL_ANDROID_EXAMPLES) |
||||
install(FILES "${CMAKE_BINARY_DIR}/bin/${_target}.apk" DESTINATION "bin" COMPONENT main) |
||||
endif() |
||||
# build java part |
||||
add_custom_command( |
||||
OUTPUT "${android_proj_bin_dir}/bin/${target}-debug.apk" |
||||
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug |
||||
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}" |
||||
MAIN_DEPENDENCY "${android_proj_bin_dir}/${ANDROID_MANIFEST_FILE}" |
||||
DEPENDS "${OpenCV_BINARY_DIR}/bin/classes.jar" opencv_java # as we are part of OpenCV we can just force this dependency |
||||
DEPENDS ${android_proj_file_deps} ${JNI_LIB_NAME}) |
||||
|
||||
add_custom_target(${target} ALL SOURCES "${android_proj_bin_dir}/bin/${target}-debug.apk" ) |
||||
add_dependencies(${target} opencv_java ${android_proj_native_deps}) |
||||
|
||||
# put the final .apk to the OpenCV's bin folder |
||||
add_custom_command(TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${android_proj_bin_dir}/bin/${target}-debug.apk" "${OpenCV_BINARY_DIR}/bin/${target}.apk") |
||||
if(INSTALL_ANDROID_EXAMPLES AND target MATCHES "^example-") |
||||
install(FILES "${OpenCV_BINARY_DIR}/bin/${target}.apk" DESTINATION "bin" COMPONENT main) |
||||
endif() |
||||
endif() |
||||
endmacro() |
||||
|
||||
|
||||
|
@ -0,0 +1,59 @@ |
||||
ocv_check_dependencies(opencv_java ${OPENCV_MODULE_opencv_java_OPT_DEPS} ${OPENCV_MODULE_opencv_java_REQ_DEPS}) |
||||
|
||||
if(NOT OCV_DEPENDENCIES_FOUND OR NOT ANT_EXECUTABLE OR NOT ANDROID_EXECUTABLE OR NOT ANDROID_TOOLS_Pkg_Revision GREATER 13) |
||||
return() |
||||
endif() |
||||
|
||||
project(opencv_test_java) |
||||
|
||||
set(opencv_test_java_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/.build") |
||||
|
||||
# get project sources |
||||
file(GLOB_RECURSE opencv_test_java_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/res/*" "${CMAKE_CURRENT_SOURCE_DIR}/src/*") |
||||
ocv_list_filterout(opencv_test_java_files ".svn") |
||||
|
||||
# copy sources out from the build tree |
||||
set(opencv_test_java_file_deps "") |
||||
foreach(f ${opencv_test_java_files} ${ANDROID_MANIFEST_FILE}) |
||||
add_custom_command( |
||||
OUTPUT "${opencv_test_java_bin_dir}/${f}" |
||||
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/${f}" "${opencv_test_java_bin_dir}/${f}" |
||||
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/${f}" |
||||
COMMENT "Copying ${f}") |
||||
list(APPEND opencv_test_java_file_deps "${CMAKE_CURRENT_SOURCE_DIR}/${f}" "${opencv_test_java_bin_dir}/${f}") |
||||
endforeach() |
||||
|
||||
# fix Android project |
||||
set(android_proj_target_files ${ANDROID_PROJECT_FILES}) |
||||
ocv_list_add_prefix(android_proj_target_files "${opencv_test_java_bin_dir}/") |
||||
file(RELATIVE_PATH __dep "${opencv_test_java_bin_dir}" "${OpenCV_BINARY_DIR}") |
||||
|
||||
add_custom_command( |
||||
OUTPUT ${android_proj_target_files} |
||||
COMMAND ${CMAKE_COMMAND} -E remove ${android_proj_target_files} |
||||
COMMAND ${ANDROID_EXECUTABLE} --silent update test-project --path "${opencv_test_java_bin_dir}" --main "${OpenCV_BINARY_DIR}" |
||||
COMMAND ${ANDROID_EXECUTABLE} --silent update project --path "${opencv_test_java_bin_dir}" --library "${__dep}" |
||||
MAIN_DEPENDENCY "${opencv_test_java_bin_dir}/${ANDROID_MANIFEST_FILE}" |
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${ANDROID_MANIFEST_FILE}" |
||||
COMMENT "Updating Android Java API test project") |
||||
|
||||
list(APPEND opencv_test_java_file_deps ${android_proj_target_files}) |
||||
|
||||
# build java part |
||||
add_custom_command( |
||||
OUTPUT "${opencv_test_java_bin_dir}/bin/OpenCVTest-debug.apk" |
||||
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug |
||||
COMMAND ${CMAKE_COMMAND} -E touch "${opencv_test_java_bin_dir}/bin/OpenCVTest-debug.apk" # needed because ant does not update the timestamp of updated apk |
||||
WORKING_DIRECTORY "${opencv_test_java_bin_dir}" |
||||
MAIN_DEPENDENCY "${opencv_test_java_bin_dir}/${ANDROID_MANIFEST_FILE}" |
||||
DEPENDS "${OpenCV_BINARY_DIR}/bin/classes.jar" opencv_java |
||||
DEPENDS ${opencv_test_java_file_deps}) |
||||
|
||||
add_custom_target(${PROJECT_NAME} ALL SOURCES "${opencv_test_java_bin_dir}/bin/OpenCVTest-debug.apk" ) |
||||
add_dependencies(${PROJECT_NAME} opencv_java) |
||||
|
||||
# put the final .apk to the OpenCV's bin folder |
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${opencv_test_java_bin_dir}/bin/OpenCVTest-debug.apk" "${OpenCV_BINARY_DIR}/bin/${PROJECT_NAME}.apk") |
||||
|
||||
add_dependencies(opencv_tests ${PROJECT_NAME}) |
||||
|
@ -1,3 +0,0 @@ |
||||
android.library.reference.1=../../../android/build |
||||
# Project target. |
||||
target=android-8 |
@ -1,3 +0,0 @@ |
||||
android.library.reference.1=../../../android/build |
||||
# Project target. |
||||
target=android-8 |
@ -0,0 +1,6 @@ |
||||
set(sample example-15-puzzle) |
||||
|
||||
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11 ${ANDROID_SDK_TARGET}) |
||||
if(TARGET ${sample}) |
||||
add_dependencies(opencv_android_examples ${sample}) |
||||
endif() |
@ -1,3 +0,0 @@ |
||||
android.library.reference.1=../../../android/build |
||||
# Project target. |
||||
target=android-8 |
@ -1,3 +0,0 @@ |
||||
android.library.reference.1=../../../android/build |
||||
# Project target. |
||||
target=android-8 |
@ -0,0 +1,6 @@ |
||||
set(sample example-face-detection) |
||||
|
||||
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11 ${ANDROID_SDK_TARGET}) |
||||
if(TARGET ${sample}) |
||||
add_dependencies(opencv_android_examples ${sample}) |
||||
endif() |
@ -1,3 +0,0 @@ |
||||
android.library.reference.1=../../OpenCV-2.3.1 |
||||
# Project target. |
||||
target=android-8 |
@ -1,3 +0,0 @@ |
||||
android.library.reference.1=../../../android/build |
||||
# Project target. |
||||
target=android-8 |
@ -0,0 +1,6 @@ |
||||
set(sample example-image-manipulations) |
||||
|
||||
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11 ${ANDROID_SDK_TARGET}) |
||||
if(TARGET ${sample}) |
||||
add_dependencies(opencv_android_examples ${sample}) |
||||
endif() |
@ -1,3 +0,0 @@ |
||||
android.library.reference.1=../../../android/build |
||||
# Project target. |
||||
target=android-8 |
@ -1,3 +0,0 @@ |
||||
android.library.reference.1=../../../android/build |
||||
# Project target. |
||||
target=android-8 |
@ -0,0 +1,7 @@ |
||||
set(sample example-tutorial-0-androidcamera) |
||||
|
||||
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" SDK_TARGET 11 ${ANDROID_SDK_TARGET}) |
||||
if(TARGET ${sample}) |
||||
add_dependencies(opencv_android_examples ${sample}) |
||||
endif() |
||||
|
@ -1,2 +0,0 @@ |
||||
# Project target. |
||||
target=android-8 |
@ -1,2 +0,0 @@ |
||||
# Project target. |
||||
target=android-11 |
@ -0,0 +1,7 @@ |
||||
set(sample example-tutorial-1-addopencv) |
||||
|
||||
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11 ${ANDROID_SDK_TARGET}) |
||||
if(TARGET ${sample}) |
||||
add_dependencies(opencv_android_examples ${sample}) |
||||
endif() |
||||
|
@ -1,3 +0,0 @@ |
||||
android.library.reference.1=../../../android/build |
||||
# Project target. |
||||
target=android-8 |
@ -1,3 +0,0 @@ |
||||
android.library.reference.1=../../../android/build |
||||
# Project target. |
||||
target=android-11 |
@ -0,0 +1,7 @@ |
||||
set(sample example-tutorial-2-opencvcamera) |
||||
|
||||
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11 ${ANDROID_SDK_TARGET}) |
||||
if(TARGET ${sample}) |
||||
add_dependencies(opencv_android_examples ${sample}) |
||||
endif() |
||||
|
@ -1,3 +0,0 @@ |
||||
android.library.reference.1=../../../android/build |
||||
# Project target. |
||||
target=android-8 |
@ -1,3 +0,0 @@ |
||||
android.library.reference.1=../../../android/build |
||||
# Project target. |
||||
target=android-8 |
@ -0,0 +1,6 @@ |
||||
set(sample example-tutorial-3-native) |
||||
|
||||
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" SDK_TARGET 11 ${ANDROID_SDK_TARGET} NATIVE_DEPS opencv_features2d) |
||||
if(TARGET ${sample}) |
||||
add_dependencies(opencv_android_examples ${sample}) |
||||
endif() |
@ -1,2 +0,0 @@ |
||||
# Project target. |
||||
target=android-8 |
@ -1,2 +0,0 @@ |
||||
# Project target. |
||||
target=android-11 |
@ -0,0 +1,12 @@ |
||||
set(sample example-tutorial-4-mixed) |
||||
|
||||
if(BUILD_FAT_JAVA_LIB) |
||||
set(native_deps opencv_java) |
||||
else() |
||||
set(native_deps opencv_features2d) |
||||
endif() |
||||
|
||||
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11 ${ANDROID_SDK_TARGET} NATIVE_DEPS ${native_deps}) |
||||
if(TARGET ${sample}) |
||||
add_dependencies(opencv_android_examples ${sample}) |
||||
endif() |
@ -1,3 +0,0 @@ |
||||
android.library.reference.1=../../../android/build |
||||
# Project target. |
||||
target=android-8 |
@ -1,3 +0,0 @@ |
||||
android.library.reference.1=../../../android/build |
||||
# Project target. |
||||
target=android-11 |
Loading…
Reference in new issue