diff --git a/WebKitDev/Functions/Install-CMake.ps1 b/WebKitDev/Functions/Install-CMake.ps1 index 4863c46..d3dbb21 100644 --- a/WebKitDev/Functions/Install-CMake.ps1 +++ b/WebKitDev/Functions/Install-CMake.ps1 @@ -28,23 +28,15 @@ function Install-CMake { [string]$installationPath ) - $major,$minor,$patch = $version.split('.'); - - # CMake releases moved to GitHub in 3.20 - if (([int]$major -ge 4) -or (([int]$major -eq 3) -and ([int]$minor -ge 20))) { - $url = ('https://github.com/Kitware/CMake/releases/download/v{0}/cmake-{0}-windows-x86_64.msi' -f $version) - } - else { - $url = ('https://cmake.org/files/v{0}.{1}/cmake-{2}-win64_x64.msi' -f $major,$minor,$version); - } - - $options = @( - 'ADD_CMAKE_TO_PATH="System"' - ); + $installerOptions = @('ADD_CMAKE_TO_PATH=System'); if ($installationPath) { - $options += ('INSTALL_ROOT="{0}"' -f $installationPath); + $installerOptions += ('INSTALL_ROOT="{0}"' -f $installationPath); } - Install-FromMsi -Name 'cmake' -url $url -Options $options; + Install-FromChoco ` + -Name 'cmake' ` + -Version $version ` + -Options @('--apply-install-arguments-to-dependencies') ` + -InstallerOptions $installerOptions; }