#!/usr/bin/env bash set -euo pipefail # install_arcgis.sh # Unpacks ArcGIS Maps SDK for Qt and installs into /opt/ArcGIS # Expects the zip at ../ArcGIS_Maps_SDK_Qt_linux_300.0.0.zip relative to repo root ZIP_PATH="${1:-../ArcGIS_Maps_SDK_Qt_linux_300.0.0.zip}" # Install into repo-local external by default so SDKs are colocated with RTI under ./external TARGET_DIR="${2:-./external/ArcGIS/MapsSDK_Qt_300.0.0}" if [[ ! -f "$ZIP_PATH" ]]; then echo "ArcGIS zip not found at $ZIP_PATH" echo "Please place ArcGIS_Maps_SDK_Qt_linux_300.0.0.zip at that path before running this script." exit 1 fi # Create target dir, prefer non-root but fall back to sudo when necessary if ! mkdir -p "$TARGET_DIR" 2>/dev/null; then sudo mkdir -p "$TARGET_DIR" fi if ! chown $(id -u):$(id -g) "$TARGET_DIR" 2>/dev/null; then sudo chown $(id -u):$(id -g) "$TARGET_DIR" || true fi echo "Extracting $ZIP_PATH to $TARGET_DIR..." unzip -q "$ZIP_PATH" -d "$TARGET_DIR" # Typical SDK layout contains lib/cmake packages and Qt plugins. Ensure CMAKE_PREFIX_PATH contains it. echo "ArcGIS SDK extracted. Add $TARGET_DIR to CMAKE_PREFIX_PATH when building:" echo " -DCMAKE_PREFIX_PATH=\"$TARGET_DIR:$CMAKE_PREFIX_PATH\"" # Optionally perform install actions if package contains an install script if [[ -x "$TARGET_DIR/install.sh" ]]; then echo "Running provided install.sh inside SDK" pushd "$TARGET_DIR" >/dev/null sudo ./install.sh || true popd >/dev/null fi echo "ArcGIS SDK unpack complete. Files are at $TARGET_DIR"