Skip to content

Commit

Permalink
Add build_android.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Jan 16, 2020
1 parent 570acbf commit fc42a64
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions build_android.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
if [ -n "$1" ]; then
ANDROID_NDK=$1
fi
if [ -z "${ANDROID_NDK}" ]; then
echo "$0 ANDROID_NDK"
exit -1
fi

if [ ! -d build ]; then
mkdir -p build
fi
cd build

cmake .. -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a with NEON" -DANDROID_PLATFORM=android-18 -DBUILD_EXAMPLE=OFF # 如果有OpenCV,则设置为ON

cmake --build . --config Release -- -j`cat /proc/cpuinfo |grep 'cpu cores' |wc -l`

cmake --build . --config Release --target install -- -j`cat /proc/cpuinfo |grep 'cpu cores' |wc -l`

cd ..

0 comments on commit fc42a64

Please sign in to comment.