blob: 3248b4c7226e95cc956cb2cee78b161808210a71 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
$ErrorActionPreference = "Stop"
trap { $host.SetShouldExit(1) }
$CMAKE_VERSION="3.15.2"
$CWD=(Get-Item -Path ".\").FullName
(new-object System.Net.WebClient). `
DownloadFile("https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-win64-x64.zip", `
"$CWD\cmake-$CMAKE_VERSION-win64-x64.zip")
unzip cmake-$CMAKE_VERSION-win64-x64.zip
$ENV:PATH="$ENV:PATH;$CWD\cmake-$CMAKE_VERSION-win64-x64\bin"
cmake --help
[Environment]::SetEnvironmentVariable(
"Path",
[Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine) + ";$CWD\cmake-$CMAKE_VERSION-win64-x64\bin",
[EnvironmentVariableTarget]::Machine)
|