# Install all development dependencies for asteria-qt on Windows. # Requires: winget (Windows 10 1709+) and an internet connection. # Run in an elevated (Administrator) PowerShell session. # # After running this script you must add Qt to your PATH / CMAKE_PREFIX_PATH. # The default Qt install path is: C:\Qt\6.x.x\msvc2022_64\ #Requires -RunAsAdministrator Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' # ── Build tools ──────────────────────────────────────────────────────────────── Write-Host "Installing build tools..." -ForegroundColor Cyan # Visual Studio Build Tools 2022 (C++ compiler, MSBuild) winget install --id Microsoft.VisualStudio.2022.BuildTools --silent --override ` "--wait --quiet --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended" # CMake winget install --id Kitware.CMake --silent # Ninja winget install --id Ninja-build.Ninja --silent # Git winget install --id Git.Git --silent # ── Qt 6 ─────────────────────────────────────────────────────────────────────── Write-Host "" Write-Host "Qt 6 cannot be installed via winget in a fully unattended way." -ForegroundColor Yellow Write-Host "Install it manually using the Qt Online Installer:" -ForegroundColor Yellow Write-Host " https://www.qt.io/download-open-source" -ForegroundColor Cyan Write-Host "" Write-Host "In the installer, select Qt 6.7+ and check these components:" -ForegroundColor Yellow Write-Host " - MSVC 2022 64-bit" Write-Host " - Qt PDF" Write-Host " - Qt Quick / Qt Declarative (included by default)" Write-Host " - Qt SVG" Write-Host " - Qt Shader Tools" Write-Host "" Write-Host "After installing, set CMAKE_PREFIX_PATH in your build commands:" -ForegroundColor Yellow Write-Host ' cmake -B build -DCMAKE_PREFIX_PATH="C:\Qt\6.7.0\msvc2022_64"' -ForegroundColor Cyan # ── vcpkg (for third-party C++ libs) ────────────────────────────────────────── Write-Host "" Write-Host "Installing vcpkg for third-party libraries..." -ForegroundColor Cyan $vcpkgDir = "C:\vcpkg" if (-not (Test-Path $vcpkgDir)) { git clone https://github.com/microsoft/vcpkg.git $vcpkgDir & "$vcpkgDir\bootstrap-vcpkg.bat" -disableMetrics } else { Write-Host "vcpkg already present at $vcpkgDir" -ForegroundColor Green } # ── Third-party libraries via vcpkg ─────────────────────────────────────────── Write-Host "" Write-Host "Installing third-party libraries via vcpkg (x64-windows)..." -ForegroundColor Cyan $vcpkg = "$vcpkgDir\vcpkg.exe" & $vcpkg install ` uchardet:x64-windows ` quazip:x64-windows ` minizip:x64-windows ` djvulibre:x64-windows ` libwpd:x64-windows Write-Host "" Write-Host "Done. Add vcpkg toolchain to your CMake configure command:" -ForegroundColor Green Write-Host " -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake" -ForegroundColor Cyan