mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Fixed Android build
This commit is contained in:
@@ -105,3 +105,6 @@ SET( ENABLE_SSE42 OFF CACHE INTERNAL "" FORCE )
|
||||
|
||||
#Enable SSSE3 instructions
|
||||
SET( ENABLE_SSSE3 OFF CACHE INTERNAL "" FORCE )
|
||||
|
||||
#Set output folder to "libs" instead of "lib" for better compatibility with java projects
|
||||
SET( LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/libs CACHE PATH "path for android libs" )
|
||||
|
||||
@@ -227,6 +227,7 @@ if( ARM_TARGET STREQUAL "armeabi" )
|
||||
set( ARMEABI true )
|
||||
set( ARMEABI_NDK_NAME "armeabi" )
|
||||
set( NEON false )
|
||||
set( CMAKE_SYSTEM_PROCESSOR "armv5te" )
|
||||
else()
|
||||
if( ARM_TARGET STREQUAL "armeabi-v7a with NEON" )
|
||||
set( NEON true )
|
||||
@@ -240,6 +241,7 @@ Supported values are: \"armeabi\", \"armeabi-v7a\", \"armeabi-v7a with NEON\", \
|
||||
endif()
|
||||
set( ARMEABI_V7A true )
|
||||
set( ARMEABI_NDK_NAME "armeabi-v7a" )
|
||||
set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
|
||||
endif()
|
||||
|
||||
#setup output directories
|
||||
@@ -248,8 +250,12 @@ set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR} CACHE PATH "root for library o
|
||||
SET( DO_NOT_CHANGE_OUTPUT_PATHS_ON_FIRST_PASS OFF CACHE BOOL "")
|
||||
if( DO_NOT_CHANGE_OUTPUT_PATHS_ON_FIRST_PASS )
|
||||
#some cmake standard modules work incorrectly if output paths are changed
|
||||
set( LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ARMEABI_NDK_NAME} CACHE PATH "path for android libs" FORCE )
|
||||
set( EXECUTABLE_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ARMEABI_NDK_NAME} CACHE PATH "Output directory for applications" FORCE)
|
||||
if( EXISTS ${CMAKE_SOURCE_DIR}/jni/CMakeLists.txt )
|
||||
# these paths are required for jni part of Android projects
|
||||
# but they may conflict with traditional unix makefile's folder structure
|
||||
set( LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ARMEABI_NDK_NAME} CACHE PATH "path for android libs" FORCE )
|
||||
set( EXECUTABLE_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ARMEABI_NDK_NAME} CACHE PATH "Output directory for applications" FORCE)
|
||||
endif()
|
||||
set( CMAKE_INSTALL_PREFIX ${ANDROID_NDK_TOOLCHAIN_ROOT}/user/${ARMEABI_NDK_NAME} CACHE STRING "path for installing" FORCE )
|
||||
endif()
|
||||
SET( DO_NOT_CHANGE_OUTPUT_PATHS_ON_FIRST_PASS ON CACHE INTERNAL "" FORCE)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
:: variables required for OpenCV build ::
|
||||
:: Note: all pathes should be specified without tailing slashes!
|
||||
SET ANDROID_NDK=C:\full\path\to\your\copy\of\android\NDK\android-ndk-r5b
|
||||
SET CMAKE_EXE=C:\full\path\to\cmake\utility\cmake.exe
|
||||
SET MAKE_EXE=C:\full\path\to\native\port\of\make\utility\make.exe
|
||||
@@ -23,4 +24,4 @@ SET BUILD_DIR=build
|
||||
::SET BUILD_DIR=build_neon
|
||||
|
||||
:::: other options
|
||||
::SET ANDROID_API_LEVEL=8 &:: android-3 is enough for OpenCV but android-8 is recommended
|
||||
::SET ANDROID_API_LEVEL=8 &:: android-3 is enough for OpenCV but android-8 is recommended
|
||||
|
||||
Reference in New Issue
Block a user