mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 05:10:10 -05:00
30 lines
1.0 KiB
PowerShell
Executable File
30 lines
1.0 KiB
PowerShell
Executable File
$erroractionpreference = "stop"
|
|
|
|
$version = "3.24.1"
|
|
|
|
if ("$env:PROCESSOR_ARCHITECTURE" -eq "AMD64") {
|
|
$sha256sum = "C1B17431A16337D517F7BA78C7067B6F143A12686CB8087F3DD32F3FA45F5AAE"
|
|
$platform = "windows-x86_64"
|
|
} elseif ("$env:PROCESSOR_ARCHITECTURE" -eq "ARM64") {
|
|
$sha256sum = "D94683F3B0E63F6EF194C621194F6E26F3735EDA70750395E0F2BBEE4023FB95"
|
|
$platform = "windows-arm64"
|
|
} else {
|
|
throw ('unknown PROCESSOR_ARCHITECTURE: ' + "$env:PROCESSOR_ARCHITECTURE")
|
|
}
|
|
|
|
$filename = "cmake-$version-$platform"
|
|
$tarball = "$filename.zip"
|
|
|
|
$outdir = $pwd.Path
|
|
$outdir = "$outdir\.gitlab"
|
|
$ProgressPreference = 'SilentlyContinue'
|
|
Invoke-WebRequest -Uri "https://github.com/Kitware/CMake/releases/download/v$version/$tarball" -OutFile "$outdir\$tarball"
|
|
$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
|
|
if ($hash.Hash -ne $sha256sum) {
|
|
exit 1
|
|
}
|
|
|
|
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
|
[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir")
|
|
Move-Item -Path "$outdir\$filename" -Destination "$outdir\cmake"
|