Skip to content

Commit

Permalink
[infra] Introduce nncc install command (#12848)
Browse files Browse the repository at this point in the history
This commit introduces nncc install command.
It simplifies nncc install path setting on local environment by using "--prefix" option.

ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]>
  • Loading branch information
hseok-oh authored Apr 5, 2024
1 parent 704bed9 commit 067abd2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions infra/nncc/command/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

import "build.configuration"

BUILD_WORKSPACE_PATH="${NNCC_PROJECT_PATH}/${BUILD_WORKSPACE_RPATH}"

if [[ ! -d "${BUILD_WORKSPACE_PATH}" ]]; then
echo "'${BUILD_WORKSPACE_RPATH}' does not exist. Please run 'configure' first"
exit 255
fi

# Check version
# TODO Remove version check when we does not support 18.04 anymore
cmp=3.15.0
ver=$(cmake --version | head -1 | cut -f3 -d" ")

mapfile -t sorted < <(printf "%s\n" "$ver" "$cmp" | sort -V)

if [[ ${sorted[0]} == "$ver" ]]; then
echo "This command requires cmake version $cmp or upper."
exit 255
fi

cmake --install ${BUILD_WORKSPACE_PATH} "$@"

0 comments on commit 067abd2

Please sign in to comment.