forked from shiguredo/momo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmake.ps1
41 lines (37 loc) · 1.57 KB
/
cmake.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
$ErrorActionPreference = 'Stop'
$WEBRTC_VERSION_FILE = Join-Path (Resolve-Path ".").Path "build\windows_x86_64\_install\webrtc\VERSIONS"
Get-Content $WEBRTC_VERSION_FILE | Foreach-Object{
if (!$_) {
continue
}
$var = $_.Split('=')
New-Variable -Name $var[0] -Value $var[1] -Force
}
$MOMO_VERSION_FILE = Join-Path (Resolve-Path ".").Path "VERSION"
Get-Content $MOMO_VERSION_FILE | Foreach-Object{
if (!$_) {
continue
}
$var = $_.Split('=')
New-Variable -Name $var[0] -Value $var[1] -Force
}
$MOMO_COMMIT = "$(git rev-parse HEAD)"
$INSTALL_DIR = (Join-Path (Resolve-Path ".").Path "build\windows_x86_64\_install").Replace("\", "/")
$MODULE_PATH = (Join-Path (Resolve-Path ".").Path "cmake").Replace("\", "/")
$SDL_MODULE_PATH = (Join-Path (Resolve-Path ".").Path "build\windows_x86_64\_install\SDL2\cmake").Replace("\", "/")
mkdir _build\windows_x86_64 -Force -ErrorAction Ignore
Push-Location _build\windows_x86_64
cmake ..\.. -G "Visual Studio 16 2019" `
-DMOMO_VERSION="$MOMO_VERSION" `
-DMOMO_COMMIT="$MOMO_COMMIT" `
-DWEBRTC_BUILD_VERSION="$WEBRTC_BUILD_VERSION" `
-DWEBRTC_READABLE_VERSION="$WEBRTC_READABLE_VERSION" `
-DWEBRTC_COMMIT="$WEBRTC_COMMIT" `
-DWEBRTC_ROOT_DIR="$INSTALL_DIR/webrtc" `
-DNVCODEC_ROOT_DIR="$INSTALL_DIR/Video_Codec_SDK" `
-DJSON_ROOT_DIR="$INSTALL_DIR/json" `
-DCLI11_ROOT_DIR="$INSTALL_DIR/CLI11" `
-DCMAKE_MODULE_PATH="$MODULE_PATH;$SDL_MODULE_PATH" `
-DCMAKE_PREFIX_PATH="$INSTALL_DIR/boost;$INSTALL_DIR/SDL2"
cmake --build . --config Release
Pop-Location