Applied the patch, received from akamaev. Also made some changes in CMake files to fix Android camera issue.
This commit is contained in:
parent
7c03b301c1
commit
3ef5bfa185
@ -459,7 +459,9 @@ if((NOT DEFINED BUILD_opencv_java OR BUILD_opencv_java) AND PYTHON_EXECUTABLE)
|
||||
endif()
|
||||
|
||||
if(BUILD_ANDROID_EXAMPLES AND NOT CAN_BUILD_ANDROID_PROJECTS)
|
||||
message(WARNING "Android examples are chosen for build, but required SDK tools are not found.")
|
||||
if(HAVE_opencv_java)
|
||||
message(WARNING "Android examples are chosen for build, but required SDK tools are not found.")
|
||||
endif()
|
||||
unset(BUILD_ANDROID_EXAMPLES CACHE)
|
||||
endif()
|
||||
|
||||
@ -744,7 +746,7 @@ if(UNIX AND NOT APPLE)
|
||||
status(" Xine:" HAVE_XINE THEN YES ELSE NO)
|
||||
|
||||
if(ANDROID)
|
||||
if(WITH_ANDROID_CAMERA)
|
||||
if(HAVE_opencv_androidcamera)
|
||||
status(" AndroidNativeCamera:" BUILD_ANDROID_CAMERA_WRAPPER THEN "YES, build for Android ${ANDROID_VERSION}" ELSE "YES, use prebuilt libraries")
|
||||
else()
|
||||
status(" AndroidNativeCamera:" "NO (native camera requires Android API level 8 or higher)")
|
||||
|
@ -103,14 +103,7 @@ SET(OpenCV2_INCLUDE_DIRS @CMAKE_OPENCV2_INCLUDE_DIRS_CONFIGCMAKE@)
|
||||
if(OpenCV2_INCLUDE_DIRS)
|
||||
include_directories(${OpenCV2_INCLUDE_DIRS})
|
||||
list(APPEND OpenCV_INCLUDE_DIRS ${OpenCV2_INCLUDE_DIRS})
|
||||
set(OpenCV_AddDebugRelease)
|
||||
if(MSVC)
|
||||
set(OpenCV_AddDebugRelease 1)
|
||||
elseif(CMAKE_GENERATOR MATCHES Xcode)
|
||||
set(OpenCV_AddDebugRelease 1)
|
||||
endif()
|
||||
|
||||
if(OpenCV_AddDebugRelease)
|
||||
set(OpenCV_LIB_DIR_OPT "${OpenCV_LIB_DIR_OPT}/Release")
|
||||
set(OpenCV_LIB_DIR_DBG "${OpenCV_LIB_DIR_DBG}/Debug")
|
||||
set(OpenCV_3RDPARTY_LIB_DIR_OPT "${OpenCV_3RDPARTY_LIB_DIR_OPT}/Release")
|
||||
@ -121,7 +114,7 @@ endif()
|
||||
# ==============================================================
|
||||
# Check OpenCV availability
|
||||
# ==============================================================
|
||||
if(ANDROID AND OpenCV_ANDROID_NATIVE_API_LEVEL LESS ANDROID_NATIVE_API_LEVEL)
|
||||
if(ANDROID AND OpenCV_ANDROID_NATIVE_API_LEVEL GREATER ANDROID_NATIVE_API_LEVEL)
|
||||
message(FATAL_ERROR "Minimum required by OpenCV API level is android-${OpenCV_ANDROID_NATIVE_API_LEVEL}")
|
||||
#always FATAL_ERROR because we can't say to the caller that OpenCV is not found
|
||||
#http://www.mail-archive.com/cmake@cmake.org/msg37831.html
|
||||
|
@ -210,7 +210,8 @@ if(APPLE)
|
||||
endif()
|
||||
endif(APPLE)
|
||||
|
||||
if(WITH_ANDROID_CAMERA AND OPENCV_MODULE_ANDROIDCAMERA)
|
||||
set(OPENCV_MODULE_ANDROIDCAMERA "ON") #TODO: fix it
|
||||
if(HAVE_opencv_androidcamera AND OPENCV_MODULE_ANDROIDCAMERA)
|
||||
set(highgui_srcs ${highgui_srcs} src/cap_android.cpp)
|
||||
add_definitions(-DHAVE_ANDROID_NATIVE_CAMERA)#TODO: remove this line
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user