-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.bat
48 lines (34 loc) · 1.28 KB
/
install.bat
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
45
46
47
48
@echo off
set DEFAULT_INSTALL_DIR=C:\Program Files\rollout-sdk
set INSTALL_DIR=%DEFAULT_INSTALL_DIR%
set PROJECT_NAME=ROX C SDK
SET ROOT_DIR=%cd%
if not "%1" == "" set INSTALL_DIR="%1"
REM TODO: check if INSTALL_DIR is writable
echo Building third party libraries.
if not exist .\vendor\build mkdir .\vendor\build
cd .\vendor\build
cmake .. -G "NMake Makefiles"
if %errorlevel% neq 0 exit /b %errorlevel%
nmake
if %errorlevel% neq 0 exit /b %errorlevel%
cd %ROOT_DIR%
echo Building %PROJECT_NAME%.
if not exist .\build\release mkdir .\build\release
cd .\build\release
cmake ..\.. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX="%INSTALL_DIR%" -DCMAKE_BUILD_TYPE=Release -DROX_CLIENT=Yes
if %errorlevel% neq 0 exit /b %errorlevel%
nmake
if %errorlevel% neq 0 exit /b %errorlevel%
echo Running tests.
set CK_DEFAULT_TIMEOUT=100
ctest --output-on-failure --timeout 100
if %errorlevel% neq 0 exit /b %errorlevel%
echo Installing %PROJECT_NAME% into %INSTALL_DIR%.
nmake install
if %errorlevel% neq 0 exit /b %errorlevel%
cd "%ROOT_DIR%"
REM TODO: add to PATH like this: (current version cuts PATH to 1024 chars)
REM if "%INSTALL_DIR%" == "%DEFAULT_INSTALL_DIR%" setx PATH "%PATH%;%INSTALL_DIR%\bin" /M
echo %PROJECT_NAME% is successfully installed into %INSTALL_DIR%.
echo %PROJECT_NAME% build finished.