From 12b2ac87200060eb93c099a97c39bb137683a824 Mon Sep 17 00:00:00 2001 From: Don Olmstead Date: Mon, 6 Oct 2025 16:30:17 -0700 Subject: [PATCH] refactor(): use choco for cmake Install cmake through chocolatey. --- WebKitDev/Functions/Install-CMake.ps1 | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) 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; }