Fixed Android build with SDK revision 14
This commit is contained in:
parent
177618984d
commit
e8032fa8e9
android/scripts
modules/java
samples/android
15-puzzle
face-detection
image-manipulations
tutorial-0-androidcamera
tutorial-1-addopencv
tutorial-2-opencvcamera
tutorial-3-native
tutorial-4-mixed
@ -33,7 +33,7 @@ cmake -C "$ANDROID_DIR/CMakeCache.android.initial.cmake" -DARM_TARGET="armeabi-v
|
||||
make -j8 install/strip || exit 1
|
||||
|
||||
cd "$PRG_DIR/opencv"
|
||||
rm -rf doc include src .classpath .project AndroidManifest.xml default.properties share/OpenCV/haarcascades share/OpenCV/lbpcascades share/OpenCV/*.cmake share/OpenCV/OpenCV.mk
|
||||
rm -rf doc include src .classpath .project AndroidManifest.xml default.properties project.properties share/OpenCV/haarcascades share/OpenCV/lbpcascades share/OpenCV/*.cmake share/OpenCV/OpenCV.mk
|
||||
|
||||
|
||||
# armeabi build
|
||||
@ -67,15 +67,26 @@ for dir in `ls -1`
|
||||
do
|
||||
if [ -f "$dir/default.properties" ]
|
||||
then
|
||||
HAS_REFERENCE=`cat "$dir/default.properties" | grep -c android.library.reference.1`
|
||||
HAS_REFERENCE=`cat "$dir/project.properties" | grep -c android.library.reference.1`
|
||||
if [ $HAS_REFERENCE = 1 ]
|
||||
then
|
||||
echo -n > "$dir/default.properties"
|
||||
echo -n > "$dir/project.properties"
|
||||
android update project --name "$dir" --target "android-8" --library "../../$OPENCV_NAME" --path "$dir"
|
||||
#echo 'android update project --name "$dir" --target "android-8" --library "../opencv$CV_VERSION" --path "$dir"'
|
||||
fi
|
||||
else
|
||||
rm -rf "$dir"
|
||||
if [ -f "$dir/default.properties" ]
|
||||
then
|
||||
HAS_REFERENCE=`cat "$dir/default.properties" | grep -c android.library.reference.1`
|
||||
if [ $HAS_REFERENCE = 1 ]
|
||||
then
|
||||
echo -n > "$dir/default.properties"
|
||||
android update project --name "$dir" --target "android-8" --library "../../$OPENCV_NAME" --path "$dir"
|
||||
#echo 'android update project --name "$dir" --target "android-8" --library "../opencv$CV_VERSION" --path "$dir"'
|
||||
fi
|
||||
else
|
||||
rm -rf "$dir"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
@ -214,7 +214,17 @@ if(ANDROID)
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/res"
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/gen"
|
||||
DEPENDS ${lib_proj_files}
|
||||
)
|
||||
)
|
||||
if (ANT_EXECUTABLE AND ANDROID_EXECUTABLE AND ANDROID_TOOLS_Pkg_Revision GREATER 13)
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
COMMAND ${ANDROID_EXECUTABLE} update lib-project --path "${CMAKE_BINARY_DIR}"
|
||||
COMMAND ${ANT_EXECUTABLE} debug
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||
DEPENDS ${lib_target}
|
||||
)
|
||||
endif()
|
||||
|
||||
add_dependencies(${lib_target} ${api_target})
|
||||
add_dependencies(${target} ${lib_target})
|
||||
|
||||
|
12
modules/java/android/project.properties
Normal file
12
modules/java/android/project.properties
Normal file
@ -0,0 +1,12 @@
|
||||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system use,
|
||||
# "build.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
|
||||
android.library=true
|
||||
# Project target.
|
||||
target=android-8
|
3
samples/android/15-puzzle/project.properties
Normal file
3
samples/android/15-puzzle/project.properties
Normal file
@ -0,0 +1,3 @@
|
||||
android.library.reference.1=../../../android/build
|
||||
# Project target.
|
||||
target=android-8
|
3
samples/android/face-detection/project.properties
Normal file
3
samples/android/face-detection/project.properties
Normal file
@ -0,0 +1,3 @@
|
||||
android.library.reference.1=../../OpenCV-2.3.1
|
||||
# Project target.
|
||||
target=android-8
|
3
samples/android/image-manipulations/project.properties
Normal file
3
samples/android/image-manipulations/project.properties
Normal file
@ -0,0 +1,3 @@
|
||||
android.library.reference.1=../../../android/build
|
||||
# Project target.
|
||||
target=android-8
|
@ -0,0 +1,2 @@
|
||||
# Project target.
|
||||
target=android-8
|
3
samples/android/tutorial-1-addopencv/project.properties
Normal file
3
samples/android/tutorial-1-addopencv/project.properties
Normal file
@ -0,0 +1,3 @@
|
||||
android.library.reference.1=../../../android/build
|
||||
# Project target.
|
||||
target=android-8
|
@ -0,0 +1,3 @@
|
||||
android.library.reference.1=../../../android/build
|
||||
# Project target.
|
||||
target=android-8
|
2
samples/android/tutorial-3-native/project.properties
Normal file
2
samples/android/tutorial-3-native/project.properties
Normal file
@ -0,0 +1,2 @@
|
||||
# Project target.
|
||||
target=android-8
|
3
samples/android/tutorial-4-mixed/project.properties
Normal file
3
samples/android/tutorial-4-mixed/project.properties
Normal file
@ -0,0 +1,3 @@
|
||||
android.library.reference.1=../../../android/build
|
||||
# Project target.
|
||||
target=android-8
|
Loading…
x
Reference in New Issue
Block a user