Commit a142a3b7 authored by Andrey Kamaev's avatar Andrey Kamaev

Fixed Android Manager build

parent ecf6b5a8
...@@ -8,6 +8,7 @@ project(${ZLIB_LIBRARY} C) ...@@ -8,6 +8,7 @@ project(${ZLIB_LIBRARY} C)
include(CheckFunctionExists) include(CheckFunctionExists)
include(CheckIncludeFile) include(CheckIncludeFile)
include(CheckCSourceCompiles) include(CheckCSourceCompiles)
include(CheckTypeSize)
# #
# Check for fseeko # Check for fseeko
...@@ -27,6 +28,14 @@ if(MSVC) ...@@ -27,6 +28,14 @@ if(MSVC)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
endif() endif()
#
# Check to see if we have large file support
#
check_type_size(off64_t OFF64_T)
if(HAVE_OFF64_T)
add_definitions(-D_LARGEFILE64_SOURCE=1)
endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein" configure_file("${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein"
"${CMAKE_CURRENT_BINARY_DIR}/zconf.h" @ONLY) "${CMAKE_CURRENT_BINARY_DIR}/zconf.h" @ONLY)
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}") ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}")
......
...@@ -150,8 +150,14 @@ OCV_OPTION(BUILD_TESTS "Build accuracy & regression tests" ...@@ -150,8 +150,14 @@ OCV_OPTION(BUILD_TESTS "Build accuracy & regression tests"
OCV_OPTION(BUILD_WITH_DEBUG_INFO "Include debug info into debug libs (not MSCV only)" ON ) OCV_OPTION(BUILD_WITH_DEBUG_INFO "Include debug info into debug libs (not MSCV only)" ON )
OCV_OPTION(BUILD_WITH_STATIC_CRT "Enables use of staticaly linked CRT for staticaly linked OpenCV" ON IF MSVC ) OCV_OPTION(BUILD_WITH_STATIC_CRT "Enables use of staticaly linked CRT for staticaly linked OpenCV" ON IF MSVC )
OCV_OPTION(BUILD_FAT_JAVA_LIB "Create fat java wrapper containing the whole OpenCV library" ON IF ANDROID AND NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX ) OCV_OPTION(BUILD_FAT_JAVA_LIB "Create fat java wrapper containing the whole OpenCV library" ON IF ANDROID AND NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(BUILD_ANDROID_SERVICE "TBD" OFF IF ANDROID ) OCV_OPTION(BUILD_ANDROID_SERVICE "TBD" OFF IF ANDROID AND ANDROID_USE_STLPORT AND ANDROID_SOURCE_TREE )
OCV_OPTION(BUILD_ANDROID_PACKAGE "TBD" OFF IF ANDROID )
if(DEFINED BUILD_opencv_nonfree AND NOT BUILD_opencv_nonfree)
OCV_OPTION(BUILD_ANDROID_PACKAGE "TBD" OFF IF ANDROID )
else()
unset(BUILD_ANDROID_PACKAGE CACHE)
endif()
# 3rd party libs # 3rd party libs
OCV_OPTION(BUILD_ZLIB "Build zlib from source" WIN32 OR IOS OR APPLE ) OCV_OPTION(BUILD_ZLIB "Build zlib from source" WIN32 OR IOS OR APPLE )
...@@ -331,15 +337,6 @@ if(UNIX) ...@@ -331,15 +337,6 @@ if(UNIX)
endif() endif()
endif() endif()
#
# Check to see if we have large file support (needed by zlib)
#
include(CheckTypeSize)
check_type_size(off64_t OFF64_T)
if(HAVE_OFF64_T)
add_definitions(-D_LARGEFILE64_SOURCE=1)
endif()
include(cmake/OpenCVPCHSupport.cmake REQUIRED) include(cmake/OpenCVPCHSupport.cmake REQUIRED)
include(cmake/OpenCVModule.cmake REQUIRED) include(cmake/OpenCVModule.cmake REQUIRED)
...@@ -529,7 +526,7 @@ if(ANDROID) ...@@ -529,7 +526,7 @@ if(ANDROID)
endif() endif()
status(" android tool:" ANDROID_EXECUTABLE THEN "${ANDROID_EXECUTABLE} (${ANDROID_TOOLS_Pkg_Desc})" ELSE NO) status(" android tool:" ANDROID_EXECUTABLE THEN "${ANDROID_EXECUTABLE} (${ANDROID_TOOLS_Pkg_Desc})" ELSE NO)
status(" ant:" ANT_EXECUTABLE THEN "${ANT_EXECUTABLE} (ver ${ANT_VERSION})" ELSE NO) status(" ant:" ANT_EXECUTABLE THEN "${ANT_EXECUTABLE} (ver ${ANT_VERSION})" ELSE NO)
status(" Build service:" BUILD_ANDROID_SERVICE THEN YES ELSE NO) status(" Google Play package:" BUILD_ANDROID_PACKAGE THEN YES ELSE NO)
endif() endif()
# ========================== GUI ========================== # ========================== GUI ==========================
......
...@@ -2,14 +2,13 @@ set(engine OpenCVEngine) ...@@ -2,14 +2,13 @@ set(engine OpenCVEngine)
set(JNI_LIB_NAME ${engine} ${engine}_jni) set(JNI_LIB_NAME ${engine} ${engine}_jni)
add_android_project(opencv_engine "${CMAKE_CURRENT_SOURCE_DIR}" SDK_TARGET 8 ${ANDROID_SDK_TARGET} IGNORE_JAVA ON) add_android_project(opencv_engine "${CMAKE_CURRENT_SOURCE_DIR}" SDK_TARGET 8 ${ANDROID_SDK_TARGET} IGNORE_JAVA ON)
link_directories("${ANDROID_SOURCE_TREE}/out/target/product/generic/system/lib" "${ANDROID_SOURCE_TREE}/bin_${ANDROID_ARCH_NAME}/system/lib") link_directories("${ANDROID_SOURCE_TREE}/out/target/product/generic/system/lib" "${ANDROID_SOURCE_TREE}/out/target/product/${ANDROID_PRODUCT}/system/lib" "${ANDROID_SOURCE_TREE}/bin_${ANDROID_ARCH_NAME}/system/lib")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-allow-shlib-undefined")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-allow-shlib-undefined")
file(GLOB engine_files "jni/BinderComponent/*.cpp" "jni/BinderComponent/*.h" "jni/include/*.h") file(GLOB engine_files "jni/BinderComponent/*.cpp" "jni/BinderComponent/*.h" "jni/include/*.h")
include_directories(jni/BinderComponent jni/include "${ANDROID_SOURCE_TREE}/frameworks/base/include" "${ANDROID_SOURCE_TREE}/system/core/include") include_directories(jni/BinderComponent jni/include)
include_directories(SYSTEM "${ANDROID_SOURCE_TREE}/frameworks/base/include" "${ANDROID_SOURCE_TREE}/system/core/include")
add_library(${engine} SHARED ${engine_files}) add_library(${engine} SHARED ${engine_files})
target_link_libraries(${engine} z binder log utils) target_link_libraries(${engine} z binder log utils)
......
...@@ -215,7 +215,7 @@ macro(add_android_project target path) ...@@ -215,7 +215,7 @@ macro(add_android_project target path)
project(${target}) project(${target})
set(android_proj_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/.build") set(android_proj_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/.build")
# get project sources # get project sources
file(GLOB_RECURSE android_proj_files RELATIVE "${path}" "${path}/res/*" "${path}/src/*") file(GLOB_RECURSE android_proj_files RELATIVE "${path}" "${path}/res/*" "${path}/src/*")
ocv_list_filterout(android_proj_files ".svn") ocv_list_filterout(android_proj_files ".svn")
...@@ -278,8 +278,6 @@ macro(add_android_project target path) ...@@ -278,8 +278,6 @@ macro(add_android_project target path)
get_target_property(android_proj_jni_location "${JNI_LIB_NAME}" LOCATION) 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}") add_custom_command(TARGET ${JNI_LIB_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} --strip-unneeded "${android_proj_jni_location}")
endif() endif()
else()
unset(JNI_LIB_NAME)
endif() endif()
# build java part # build java part
...@@ -302,6 +300,8 @@ macro(add_android_project target path) ...@@ -302,6 +300,8 @@ macro(add_android_project target path)
DEPENDS ${android_proj_file_deps} ${JNI_LIB_NAME}) DEPENDS ${android_proj_file_deps} ${JNI_LIB_NAME})
endif() endif()
unset(JNI_LIB_NAME)
add_custom_target(${target} ALL SOURCES "${android_proj_bin_dir}/bin/${target}-debug.apk" ) add_custom_target(${target} ALL SOURCES "${android_proj_bin_dir}/bin/${target}-debug.apk" )
if(NOT android_proj_IGNORE_JAVA) if(NOT android_proj_IGNORE_JAVA)
add_dependencies(${target} opencv_java) add_dependencies(${target} opencv_java)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment