-
Notifications
You must be signed in to change notification settings - Fork 2
/
addPathsToEnvVariables.ps1
22 lines (18 loc) · 1.29 KB
/
addPathsToEnvVariables.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Get the location of the script, that is assumed to be the install prefix
$installPrefix = $PSScriptRoot
Write-Host 'Adding ' + $installPrefix + ' to the CMAKE_PREFIX_PATH User enviroment variable.'
$currVar = [System.Environment]::GetEnvironmentVariable('CMAKE_PREFIX_PATH', 'User');
$newVar = $currVar + ';' + $installPrefix;
[System.Environment]::SetEnvironmentVariable('CMAKE_PREFIX_PATH', $newVar, 'User');
Write-Host 'Adding ' + $installPrefix + '\debug to the CMAKE_PREFIX_PATH User enviroment variable.'
$currVar = [System.Environment]::GetEnvironmentVariable('CMAKE_PREFIX_PATH', 'User');
$newVar = $currVar + ';' + $installPrefix + '\debug';
[System.Environment]::SetEnvironmentVariable('CMAKE_PREFIX_PATH', $newVar, 'User');
Write-Host 'Adding ' + $installPrefix + '\bin to the Path User enviroment variable.'
$currVar = [System.Environment]::GetEnvironmentVariable('Path', 'User');
$newVar = $currVar + ';' + $installPrefix + '\bin' ;
[System.Environment]::SetEnvironmentVariable('Path', $newVar, 'User');
Write-Host 'Adding ' + $installPrefix + '\debug\bin to the Path User enviroment variable.'
$currVar = [System.Environment]::GetEnvironmentVariable('Path', 'User');
$newVar = $currVar + ';' + $installPrefix + '\debug\bin' ;
[System.Environment]::SetEnvironmentVariable('Path', $newVar, 'User');