Files
location_plotter/macos/setup-macos.sh
T
onur cayan 50a5735140
Platform builds / linux (ubuntu-22.04) (push) Has been cancelled
Platform builds / linux (ubuntu-24.04) (push) Has been cancelled
Platform builds / macos (push) Has been cancelled
Organize Linux and macOS as separate applications
2026-08-14 13:12:54 +03:00

48 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
if [[ "$(uname -s)" != "Darwin" ]]; then
echo "Bu kurulum betigi macOS icindir." >&2
exit 1
fi
if ! command -v brew >/dev/null 2>&1; then
echo "Homebrew bulunamadi. Once https://brew.sh adresindeki Homebrew kurulumunu tamamlayin." >&2
exit 1
fi
echo "Gerekli macOS paketleri kuruluyor..."
brew install cmake qt
qt_prefix="$(brew --prefix qt)"
parallel_jobs="$(sysctl -n hw.logicalcpu 2>/dev/null || echo 4)"
if [[ -f build/CMakeCache.txt ]]; then
cached_system="$(sed -n 's/^CMAKE_SYSTEM_NAME:INTERNAL=//p' build/CMakeCache.txt)"
if [[ -n "$cached_system" && "$cached_system" != "Darwin" ]]; then
echo "Build klasoru macOS disinda bir sisteme ait. 'macos/build' klasorunu silip tekrar deneyin." >&2
exit 1
fi
fi
echo "Uygulama derleniyor..."
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$qt_prefix"
cmake --build build --parallel "$parallel_jobs"
echo "Testler calistiriliyor..."
ctest --test-dir build --output-on-failure
echo "macOS uygulama paketi hazirlaniyor..."
"$qt_prefix/bin/macdeployqt" build/location_plotter.app -always-overwrite
echo
echo "Kurulum tamamlandi. Uygulamayi baslatmak icin:"
echo " ./run.sh"
echo
echo "USB UART icin port listesinden /dev/cu.usb... aygitini secin."
echo "/dev/tty.usb... gorunuyorsa o yol da desteklenir."