-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpackage_windows.bat
More file actions
44 lines (36 loc) · 1.33 KB
/
package_windows.bat
File metadata and controls
44 lines (36 loc) · 1.33 KB
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
42
43
44
@echo off
setlocal
rem Extract version from CMakeLists.txt
for /f "delims=" %%v in ('powershell -NoProfile -Command ^
"([regex]::Match((Get-Content CMakeLists.txt -Raw), 'project\s*\([^)]*VERSION\s+([0-9]+\.[0-9]+\.[0-9]+)')).Groups[1].Value"') do set VERSION=%%v
if "%VERSION%"=="" (
echo ERROR: could not extract version from CMakeLists.txt
exit /b 1
)
echo Packaging sharedgl v%VERSION%
rem Clean previous build
if exist build rmdir /s /q build
mkdir build
cd build
cmake -DCMAKE_GENERATOR_PLATFORM=x64 ..
if errorlevel 1 exit /b %errorlevel%
cmake --build . --target sharedgl-core --config Release
if errorlevel 1 exit /b %errorlevel%
cmake -DCMAKE_GENERATOR_PLATFORM=Win32 ..
if errorlevel 1 exit /b %errorlevel%
cmake --build . --target sharedgl-core --config Release
if errorlevel 1 exit /b %errorlevel%
cd ..
rem Stage install/uninstall scripts alongside the DLLs
copy /y .\scripts\wininstall.bat .\build\Release\wininstall.bat
copy /y .\scripts\winuninstall.bat .\build\Release\winuninstall.bat
rem Zip the four artifacts
cd build\Release
powershell -NoProfile -Command ^
"Compress-Archive -Force -Path wininstall.bat,winuninstall.bat,sharedgl64.dll,sharedgl32.dll -DestinationPath sharedgl-v%VERSION%-windows.zip"
if errorlevel 1 (
cd ..\..
exit /b 1
)
cd ..\..
echo Done: build\Release\sharedgl-v%VERSION%-windows.zip