forked from opencor/opencor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcd.bat
53 lines (36 loc) · 868 Bytes
/
cd.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
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET AppDir=%~dp0
IF EXIST !AppDir!build (
FOR %%X IN (ninja.exe) DO (
SET NinjaFound=%%~$PATH:X
)
IF DEFINED NinjaFound (
SET Generator=Ninja
SET CMakeGenerator=Ninja
) ELSE (
SET Generator=JOM
SET CMakeGenerator=NMake Makefiles JOM
)
TITLE Generating OpenCOR's documentation using !Generator!...
SET OrigDir=!CD!
CD !AppDir!build
cmake -G "!CMakeGenerator!" ../doc
SET ExitCode=!ERRORLEVEL!
IF NOT !ExitCode! EQU 0 (
CD !OrigDir!
EXIT /B !ExitCode!
)
IF DEFINED NinjaFound (
ninja
SET ExitCode=!ERRORLEVEL!
) ELSE (
jom
SET ExitCode=!ERRORLEVEL!
)
CD !OrigDir!
EXIT /B !ExitCode!
) ELSE (
ECHO OpenCOR's build directory is missing.
EXIT /B 1
)