exit 255
fi
-SKIP_CONFIGURE="0"
-SKIP_BUILD="0"
EXTRA_OPTIONS=()
-# TODO Remove '--skipbuild' and '--skipconfigure'
while [ "$#" -ne 0 ]; do
CUR="$1"
NNAS_INSTALL_PREFIX="$2"
shift 2
;;
- '--skipconfigure')
- SKIP_CONFIGURE="1"
- shift
- ;;
- '--skipbuild')
- SKIP_CONFIGURE="1"
- SKIP_BUILD="1"
- shift
- ;;
'--')
shift
while [ "$#" -ne 0 ]; do
esac
done
-if [[ "${SKIP_CONFIGURE}" == "1" ]]; then
- if [[ -z "${NNAS_BUILD_PREFIX}" ]]; then
- echo "ERROR: NNAS_BUILD_PREFIX is not specified"
- exit 255
- fi
-
- if [[ ! -d "${NNAS_BUILD_PREFIX}" ]]; then
- echo "ERROR: cannot find ${NNAS_BUILD_PREFIX} path"
- exit 255
- fi
-
- pushd "${NNAS_BUILD_PREFIX}" > /dev/null
- if [[ ! -e nncc/CMakeCache.txt ]]; then
- echo "ERROR: cannot find nncc cmake build setting cache file CMakeCache.txt"
- exit 255
- fi
-
- NNAS_INSTALL_PREFIX="$(grep 'CMAKE_INSTALL_PREFIX:PATH=' nncc/CMakeCache.txt | cut -d '=' -f 2)"
- popd > /dev/null
-fi
-
# Q. Is it better to have the default value for NNAS_INSTALL_PREFIX?
# TODO Show USAGE
if [[ -z "${NNAS_INSTALL_PREFIX}" ]]; then
# Tools
REQUIRED_UNITS+=("tf2tflite" "tf2circle")
-if [[ "${SKIP_CONFIGURE}" == "0" ]]; then
-
- # TODO Use "nncc configure" and "nncc build"
- cmake \
- -DCMAKE_INSTALL_PREFIX="${NNCC_INSTALL_PREFIX}" \
- -DBUILD_WHITELIST=$(join_by ";" "${REQUIRED_UNITS[@]}") \
- ${EXTRA_OPTIONS[@]} \
- "${NNAS_PROJECT_PATH}/infra/nncc"
-fi
-
-if [[ "${SKIP_BUILD}" == "0" ]]; then
- cmake --build . -- all
-fi
+# TODO Use "nncc configure" and "nncc build"
+cmake \
+ -DCMAKE_INSTALL_PREFIX="${NNCC_INSTALL_PREFIX}" \
+ -DBUILD_WHITELIST=$(join_by ";" "${REQUIRED_UNITS[@]}") \
+ ${EXTRA_OPTIONS[@]} \
+ "${NNAS_PROJECT_PATH}/infra/nncc"
+cmake --build . -- all
cmake --build . -- install
# Install NN Package tools