-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmake.bat
55 lines (40 loc) · 1.09 KB
/
make.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
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
FOR %%X IN (ninja.exe) DO (
SET NinjaFound=%%~$PATH:X
)
IF DEFINED NinjaFound (
SET Generator=Ninja
) ELSE (
SET Generator=JOM
)
TITLE Making the developer documentation for OpenCOR (using !Generator!)...
IF NOT DEFINED NinjaFound (
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" (
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
) ELSE (
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
)
)
CD build
IF DEFINED NinjaFound (
SET CMakeGenerator=Ninja
) ELSE (
SET CMakeGenerator=NMake Makefiles
)
cmake -G "!CMakeGenerator!" ..
SET ExitCode=!ERRORLEVEL!
IF !ExitCode! EQU 0 (
FOR /F "TOKENS=1,* DELIMS= " %%X IN ("%*") DO (
SET Args=%%Y
)
IF DEFINED NinjaFound (
ninja !Args!
SET ExitCode=!ERRORLEVEL!
) ELSE (
nmake /f Makefile !Args!
SET ExitCode=!ERRORLEVEL!
)
)
CD ..
EXIT /B !ExitCode!