forked from opencor/opencor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cd
executable file
·51 lines (36 loc) · 869 Bytes
/
cd
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
#!/bin/bash
appDir=$(cd $(dirname $0); pwd)
if [ -d $appDir/build ]; then
if [ "`hash ninja 2>&1`" = "" ]; then
ninjaFound=true
generator="Ninja"
cmakeGenerator="Ninja"
else
ninjaFound=false
generator="Make"
cmakeGenerator="Unix Makefiles"
fi
echo -e "\033[44;37;1mGenerating OpenCOR's documentation using $generator...\033[0m"
origDir=`pwd`
cd $appDir/build
cmake -G "$cmakeGenerator" ../doc
exitCode=$?
if [ $exitCode -ne 0 ]; then
cd $origDir
exit $exitCode
fi
if [ $ninjaFound = true ]; then
ninja
else
make
fi
exitCode=$?
cd $origDir
if [ $exitCode -eq 0 ]; then
echo -e "\033[42;37;1mAll done!\033[0m"
fi
exit $exitCode
else
echo "OpenCOR's build directory is missing."
exit 1
fi