#!/usr/bin/env bash # Builds ithaca_rgbd_server against the SDK build_sdk.sh located. Prints nothing # but the binary path on success. set -euo pipefail here=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) repo=$(cd "$here/.." && pwd) # SDK locations come from build_sdk.sh (or the environment, when a caller already # knows them). if [[ -z "${OB_SDK_ROOT:-}" || -z "${OB_SDK_BUILD:-}" ]]; then eval "$("$here/build_sdk.sh")" fi build="$repo/server/build" mkdir -p "$build" ( cd "$build" cmake "$repo/server" \ -DCMAKE_BUILD_TYPE=Release \ -DOB_SDK_ROOT="$OB_SDK_ROOT" \ -DOB_SDK_BUILD="$OB_SDK_BUILD" \ -DOB_SDK_GENERATED="${OB_SDK_GENERATED:-$OB_SDK_ROOT/build/src/generated}" >&2 make -j"$(nproc)" >&2 ) bin="$build/ithaca_rgbd_server" [[ -x "$bin" ]] || { echo "build failed: $bin absent" >&2; exit 1; } echo "$bin"