-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathinstall.ps1
More file actions
40 lines (35 loc) · 860 Bytes
/
Copy pathinstall.ps1
File metadata and controls
40 lines (35 loc) · 860 Bytes
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
param(
[string]$BuildDir = "",
[string]$BuildType = "Release",
[string]$Prefix = "",
[int]$Parallel = [Environment]::ProcessorCount
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$rootDir = $PSScriptRoot
if ([string]::IsNullOrWhiteSpace($BuildDir)) {
$BuildDir = Join-Path $rootDir "build"
}
if ([string]::IsNullOrWhiteSpace($Prefix)) {
$Prefix = Join-Path $rootDir "dist"
}
$configureArgs = @(
"-S", $rootDir,
"-B", $BuildDir,
"-DCMAKE_BUILD_TYPE=$BuildType",
"-DCMAKE_INSTALL_PREFIX=$Prefix"
)
$buildArgs = @(
"--build", $BuildDir,
"--parallel", $Parallel,
"--config", $BuildType
)
$installArgs = @(
"--install", $BuildDir,
"--config", $BuildType,
"--prefix", $Prefix
)
& cmake @configureArgs
& cmake @buildArgs
& cmake @installArgs
Write-Host "Installed Smash++ binaries to $(Join-Path $Prefix 'bin')"