Skip to content

Commit 188ec7e

Browse files
authored
fix(): Use GitHub for CMake 3.20+ downloads (#18)
1 parent ef16e86 commit 188ec7e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

WebKitDev/Functions/Install-CMake.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ Function Install-CMake {
3030

3131
$major, $minor, $patch = $version.split('.');
3232

33-
$url = ('https://cmake.org/files/v{0}.{1}/cmake-{2}-win64-x64.msi' -f $major, $minor, $version);
33+
# CMake releases moved to GitHub in 3.20
34+
if (([int]$major -ge 4) -or (([int]$major -eq 3) -and ([int]$minor -ge 20))) {
35+
$url = ('https://github.com/Kitware/CMake/releases/download/v{0}/cmake-{0}-windows-x86_64.msi' -f $version)
36+
} else {
37+
$url = ('https://cmake.org/files/v{0}.{1}/cmake-{2}-win64_x64.msi' -f $major, $minor, $version);
38+
}
3439

3540
$options = @(
3641
'ADD_CMAKE_TO_PATH="System"'

0 commit comments

Comments
 (0)