48 lines
1.3 KiB
Bash
Executable File
48 lines
1.3 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 "Baska bir sisteme ait build klasoru yeniden olusturuluyor."
|
|
rm -rf build
|
|
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."
|