Merge pull request #878 from apavlenko:better_glue_search
This commit is contained in:
commit
87fcd2342f
@ -176,7 +176,8 @@ macro(android_get_compatible_target VAR)
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
unset(__android_project_chain CACHE)
|
unset(__android_project_chain CACHE)
|
||||||
#add_android_project(target_name ${path} NATIVE_DEPS opencv_core LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11)
|
|
||||||
|
# add_android_project(target_name ${path} NATIVE_DEPS opencv_core LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11)
|
||||||
macro(add_android_project target path)
|
macro(add_android_project target path)
|
||||||
# parse arguments
|
# parse arguments
|
||||||
set(android_proj_arglist NATIVE_DEPS LIBRARY_DEPS SDK_TARGET IGNORE_JAVA IGNORE_MANIFEST)
|
set(android_proj_arglist NATIVE_DEPS LIBRARY_DEPS SDK_TARGET IGNORE_JAVA IGNORE_MANIFEST)
|
||||||
@ -212,6 +213,16 @@ macro(add_android_project target path)
|
|||||||
ocv_check_dependencies(${android_proj_NATIVE_DEPS} opencv_java)
|
ocv_check_dependencies(${android_proj_NATIVE_DEPS} opencv_java)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(EXISTS "${path}/jni/Android.mk" )
|
||||||
|
# find if native_app_glue is used
|
||||||
|
file(STRINGS "${path}/jni/Android.mk" NATIVE_APP_GLUE REGEX ".*(call import-module,android/native_app_glue)" )
|
||||||
|
if(NATIVE_APP_GLUE)
|
||||||
|
if(ANDROID_NATIVE_API_LEVEL LESS 9 OR NOT EXISTS "${ANDROID_NDK}/sources/android/native_app_glue")
|
||||||
|
set(OCV_DEPENDENCIES_FOUND FALSE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
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}")
|
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})
|
project(${target})
|
||||||
@ -268,9 +279,6 @@ macro(add_android_project target path)
|
|||||||
file(STRINGS "${path}/jni/Android.mk" JNI_LIB_NAME REGEX "LOCAL_MODULE[ ]*:=[ ]*.*" )
|
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}")
|
string(REGEX REPLACE "LOCAL_MODULE[ ]*:=[ ]*([a-zA-Z_][a-zA-Z_0-9]*)[ ]*" "\\1" JNI_LIB_NAME "${JNI_LIB_NAME}")
|
||||||
|
|
||||||
# find using of native app glue to determine native activity
|
|
||||||
file(STRINGS "${path}/jni/Android.mk" NATIVE_APP_GLUE REGEX ".*(call import-module,android/native_app_glue)" )
|
|
||||||
|
|
||||||
if(JNI_LIB_NAME)
|
if(JNI_LIB_NAME)
|
||||||
ocv_include_modules_recurse(${android_proj_NATIVE_DEPS})
|
ocv_include_modules_recurse(${android_proj_NATIVE_DEPS})
|
||||||
ocv_include_directories("${path}/jni")
|
ocv_include_directories("${path}/jni")
|
||||||
|
@ -10,16 +10,13 @@ add_subdirectory(15-puzzle)
|
|||||||
add_subdirectory(face-detection)
|
add_subdirectory(face-detection)
|
||||||
add_subdirectory(image-manipulations)
|
add_subdirectory(image-manipulations)
|
||||||
add_subdirectory(color-blob-detection)
|
add_subdirectory(color-blob-detection)
|
||||||
|
|
||||||
if (ANDROID_NATIVE_API_LEVEL GREATER 8)
|
|
||||||
add_subdirectory(native-activity)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_subdirectory(tutorial-1-camerapreview)
|
add_subdirectory(tutorial-1-camerapreview)
|
||||||
add_subdirectory(tutorial-2-mixedprocessing)
|
add_subdirectory(tutorial-2-mixedprocessing)
|
||||||
add_subdirectory(tutorial-3-cameracontrol)
|
add_subdirectory(tutorial-3-cameracontrol)
|
||||||
|
|
||||||
#hello-android sample
|
add_subdirectory(native-activity)
|
||||||
|
|
||||||
|
# hello-android sample
|
||||||
if(HAVE_opencv_highgui)
|
if(HAVE_opencv_highgui)
|
||||||
ocv_include_modules_recurse(opencv_highgui opencv_core)
|
ocv_include_modules_recurse(opencv_highgui opencv_core)
|
||||||
add_executable(hello-android hello-android/main.cpp)
|
add_executable(hello-android hello-android/main.cpp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user