-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathbuild-opencv3-static-android.sh
executable file
·112 lines (105 loc) · 2.64 KB
/
build-opencv3-static-android.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/usr/bin/env bash
# build opencv 3.4.11 for android static (.a) by benjaminwan 2020.8.21
export ANDROID_NDK=/path/to/your/ndk/17.2.4988734
cmakeParams(){
cmake -DCMAKE_BUILD_TYPE=RELEASE\
-DANDROID_ABI=$1 \
-DANDROID_ARM_NEON=ON \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
-DBUILD_ANDROID_PROJECTS=OFF \
-DBUILD_ANDROID_EXAMPLES=OFF \
-DBUILD_CUDA_STUBS=OFF \
-DBUILD_DOCS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_IPP_IW=OFF \
-DBUILD_ITT=OFF \
-DBUILD_JASPER=OFF \
-DBUILD_JAVA=OFF \
-DBUILD_JPEG=OFF \
-DBUILD_LIST=OFF \
-DBUILD_OPENEXR=OFF \
-DBUILD_PACKAGE=OFF \
-DBUILD_PERF_TESTS=OFF \
-DBUILD_PNG=OFF \
-DBUILD_PROTOBUF=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_TBB=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_TIFF=OFF \
-DBUILD_USE_SYMLINKS=OFF \
-DBUILD_WEBP=OFF \
-DBUILD_WITH_DEBUG_INFO=OFF \
-DBUILD_WITH_DYNAMIC_IPP=OFF \
-DBUILD_ZLIB=OFF \
-DBUILD_opencv_apps=OFF \
-DBUILD_opencv_calib3d=OFF \
-DBUILD_opencv_core=ON \
-DBUILD_opencv_dnn=OFF \
-DBUILD_opencv_features2d=OFF \
-DBUILD_opencv_flann=OFF \
-DBUILD_opencv_highgui=ON \
-DBUILD_opencv_imgcodecs=ON \
-DBUILD_opencv_imgproc=ON \
-DBUILD_opencv_java_bindings_generator=OFF \
-DBUILD_opencv_js=OFF \
-DBUILD_opencv_ml=OFF \
-DBUILD_opencv_objdetect=OFF \
-DBUILD_opencv_photo=OFF \
-DBUILD_opencv_python2=OFF \
-DBUILD_opencv_python_bindings_generator=OFF \
-DBUILD_opencv_python_tests=OFF \
-DBUILD_opencv_shape=OFF \
-DBUILD_opencv_stitching=OFF \
-DBUILD_opencv_superres=OFF \
-DBUILD_opencv_ts=OFF \
-DBUILD_opencv_video=OFF \
-DBUILD_opencv_videoio=OFF \
-DBUILD_opencv_videostab=OFF \
-DBUILD_opencv_world=ON \
-DWITH_1394=OFF \
-DWITH_ARITH_DEC=OFF \
-DWITH_ARITH_ENC=OFF \
-DWITH_AVFOUNDATION=OFF \
-DWITH_EIGEN=OFF \
-DWITH_FFMPEG=OFF \
-DWITH_GSTREAMER=OFF \
-DWITH_IMGCODEC_HDR=OFF \
-DWITH_IMGCODEC_PXM=OFF \
-DWITH_IMGCODEC_SUNRASTER=OFF \
-DWITH_IPP=OFF \
-DWITH_ITT=OFF \
-DWITH_JASPER=OFF \
-DWITH_JPEG=OFF \
-DWITH_LAPACK=OFF \
-DWITH_OPENEXR=OFF \
-DWITH_PNG=OFF \
-DWITH_PROTOBUF=OFF \
-DWITH_PTHREADS_PF=OFF \
-DWITH_QUIRC=OFF \
-DWITH_TIFF=OFF \
-DWITH_VTK=OFF \
-DWITH_WEBP=OFF \
..
make -j8
make install
}
##### android armv7
mkdir -p build-android-armv7
pushd build-android-armv7
cmakeParams "armeabi-v7a"
popd
##### android arm64-v8a
mkdir -p build-android-arm64v8
pushd build-android-arm64v8
cmakeParams "arm64-v8a"
popd
##### android x86
mkdir -p build-android-x86
pushd build-android-x86
cmakeParams "x86"
popd
##### android x86_64
mkdir -p build-android-x86_64
pushd build-android-x86_64
cmakeParams "x86_64"
popd