mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-09 08:40:11 -06:00
30 lines
1.0 KiB
PowerShell
Executable File
30 lines
1.0 KiB
PowerShell
Executable File
$erroractionpreference = "stop"
|
|
|
|
$version = "3.27.6"
|
|
|
|
if ("$env:PROCESSOR_ARCHITECTURE" -eq "AMD64") {
|
|
$sha256sum = "F013A0CCA091AA953F9A60A99292EC7A20AE3F9CEB05CB5C08EBE164097C526F"
|
|
$platform = "windows-x86_64"
|
|
} elseif ("$env:PROCESSOR_ARCHITECTURE" -eq "ARM64") {
|
|
$sha256sum = "980B7E532D77BFB4E5814C76403242C503019F1C0699440220CF2D527C8FF350"
|
|
$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"
|