File tree Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -28,23 +28,15 @@ function Install-CMake {
2828 [string ]$installationPath
2929 )
3030
31- $major , $minor , $patch = $version.split (' .' );
32-
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- }
37- else {
38- $url = (' https://cmake.org/files/v{0}.{1}/cmake-{2}-win64_x64.msi' -f $major , $minor , $version );
39- }
40-
41- $options = @ (
42- ' ADD_CMAKE_TO_PATH="System"'
43- );
31+ $installerOptions = @ (' ADD_CMAKE_TO_PATH=System' );
4432
4533 if ($installationPath ) {
46- $options += (' INSTALL_ROOT="{0}"' -f $installationPath );
34+ $installerOptions += (' INSTALL_ROOT="{0}"' -f $installationPath );
4735 }
4836
49- Install-FromMsi - Name ' cmake' - url $url - Options $options ;
37+ Install-FromChoco `
38+ - Name ' cmake' `
39+ - Version $version `
40+ - Options @ (' --apply-install-arguments-to-dependencies' ) `
41+ - InstallerOptions $installerOptions ;
5042}
You can’t perform that action at this time.
0 commit comments