forked from carla-simulator/carla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetup.bat
138 lines (117 loc) · 3.26 KB
/
Setup.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
@echo off
setlocal
set LOCAL_PATH=%~dp0
set INSTALLERS_DIR=%LOCAL_PATH%Util\InstallersWin\
set INSTALLATION_DIR=%LOCAL_PATH%Util\Build\
set VERSION_FILE=%LOCAL_PATH%Util\ContentVersions.txt
set CONTENT_DIR=%LOCAL_PATH%Unreal\CarlaUE4\Content
:arg-parse
if not "%1"=="" (
if "%1"=="-j" (
set NUMBER_OF_ASYNC_JOBS=%2
shift
)
if "%1"=="--boost-toolset" (
set TOOLSET=%2
shift
)
if "%1"=="-h" (
goto help
)
if "%1"=="--help" (
goto help
)
shift
goto :arg-parse
)
if [%TOOLSET%] == [] set TOOLSET=msvc-14.1
if [%NUMBER_OF_ASYNC_JOBS%] == [] set NUMBER_OF_ASYNC_JOBS=1
echo Asynchronous jobs: %NUMBER_OF_ASYNC_JOBS%
echo Boost toolset: %TOOLSET%
echo Install directory: %INSTALLATION_DIR%
if not exist "%CONTENT_DIR%" (
echo Creating %CONTENT_DIR% folder...
mkdir %CONTENT_DIR%
)
echo.
echo Installing Protobuf...
call %INSTALLERS_DIR%install_proto.bat ^
--build-dir %INSTALLATION_DIR% ^
-j %NUMBER_OF_ASYNC_JOBS%
if not defined install_proto (
echo.
echo Failed while installing Protobuf.
goto failed
)
echo.
echo Installing Boost...
call %INSTALLERS_DIR%install_boost.bat ^
--build-dir %INSTALLATION_DIR% ^
--toolset %TOOLSET% ^
-j %NUMBER_OF_ASYNC_JOBS%
if not defined install_boost (
echo.
echo Failed while installing Boost.
goto failed
)
FOR /F "tokens=2" %%i in (%VERSION_FILE%) do (
set HASH=%%i
)
set URL=https://drive.google.com/open?id=%HASH%
FOR /F "tokens=1 delims=:" %%i in (%VERSION_FILE%) do (
set ASSETS_VERSION=%%i
)
goto success
:success
echo.
echo.
echo ###########
echo # SUCCESS #
echo ###########
echo.
echo IMPORTANT!
echo.
echo All the CARLA library dependences should be installed now.
echo (You can remove all "*-src" folders in %INSTALLATION_DIR% directory)
echo.
echo You only need the ASSET PACK with all the meshes and textures.
echo.
echo This script provides the assets for CARLA %ASSETS_VERSION%
echo If you want another asset version, search it in %VERSION_FILE%.
echo You can download the assets from here:
echo.
echo %URL%
echo.
echo Unzip it in the "%CONTENT_DIR%" folder.
echo After that, please run the "Rebuild.bat".
goto eof
:help
echo --------
echo HELP
echo --------
echo.
echo Commands:
echo -h, --help -^> Shows this dialog.
echo -j ^<N^> -^> N is the integer number of async jobs while compiling (default=1).
echo --boost-toolset [T] -^> Toolset corresponding to your compiler ^(default=^*^):
echo Visual Studio 2013 -^> msvc-12.0
echo Visual Studio 2015 -^> msvc-14.0
echo Visual Studio 2017 -^> msvc-14.1 *
goto eof
:failed
echo.
echo Ok, and error ocurred, don't panic!
echo We have different platforms where you can find some help :)
echo.
echo - First of all you can try to build CARLA manually:
echo http://carla.readthedocs.io/en/latest/how_to_build_on_windows/
echo.
echo - If the problem persists, you can ask on our Github's "Building on Windows" issue:
echo https://github.com/carla-simulator/carla/issues/21
echo.
echo - Or just use our Discord channel!
echo We'll be glad to help you there :)
echo https://discord.gg/42KJdRj
goto eof
:eof
endlocal