forked from H-uru/Plasma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare_env.ps1
41 lines (35 loc) · 1.58 KB
/
prepare_env.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
$devlibs_url = "http://guildofwriters.org/tools/devlibs.zip"
if (!(Test-Path -PathType Container build)) {
Write-Host "Creating build folder... " -noNewLine
New-Item -ItemType directory build | Out-Null
Write-Host "OK" -foregroundColor Green
}
Set-Location build
$path = (Get-Location).Path
if (!(Test-Path -PathType Container devlibs)) {
Write-Host "Downloading development libraries... " -noNewLine
## This only works in PS3+ so we'll download the file directly
# Invoke-WebRequest $devlibs_url -OutFile devlibs.zip
$client = New-Object System.Net.WebClient
$client.DownloadFile($devlibs_url, $path + "\devlibs.zip")
Write-Host "OK" -foregroundColor Green
Write-Host "Extracting development libraries... " -noNewLine
New-Item -ItemType directory devlibs | Out-Null
$shell_app = New-Object -com shell.application
$zip = $shell_app.namespace($path + "\devlibs.zip")
$dest = $shell_app.namespace($path + "\devlibs")
$dest.CopyHere($zip.items(), 0x14)
Write-Host "OK" -foregroundColor Green
}
if(Get-ChildItem Env:PATH | Where-Object {$_.Value -match "CMake"}) {
Write-Host "Running CMake to configure build system... "
cmake -DCMAKE_INSTALL_PREFIX=devlibs -DPLASMA_BUILD_TOOLS=OFF -DPLASMA_BUILD_RESOURCE_DAT=OFF -G "Visual Studio 12" ..
} else {
Write-Host "CMake not found in PATH."
Write-Host "Please run the CMake installer and select the option to add CMake to your system PATH."
}
if ($Host.Name -eq "ConsoleHost") {
Write-Host ""
Write-Host "Press any key to continue..."
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp") > $null
}