#!/bin/bash set -e BASEDIR=$(cd "$(dirname "$0")"; pwd) mkdir -p ${BASEDIR}/build && cd ${BASEDIR}/build if echo "$@" | grep -iq r; then BUILD_TYPE=RELEASE else BUILD_TYPE=DEBUG fi if echo "$@" | grep -iq e; then #------ compile for euler ------------------- TOOLCHAIN=${BASEDIR}/toolchains/armv7l_openeuler_setup.cmake BUILD_PREFIX=armv7l-openeular else #------- compile for arm32 ------------------ TOOLCHAIN=${BASEDIR}/toolchains/armv7l_linux_setup.cmake BUILD_PREFIX=armv7l-linux fi mkdir -p ${BUILD_PREFIX} && cd ${BUILD_PREFIX} rm -f CMakeCache.txt cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN} -DEXECUTABLE_OUTPUT_PATH=${BASEDIR}/bin/${BUILD_PREFIX} -DLIBRARY_OUTPUT_PATH=${BASEDIR}/lib/${BUILD_PREFIX} ../.. cmake --build . -j 6 --