-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_spaceracer.sh
66 lines (46 loc) · 1.26 KB
/
build_spaceracer.sh
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
#!/bin/sh
# Parameter für Qt-Pfad
QT_DIR=/opt/qt/4.7.1
ADTF_DIR=/opt/adtf/2.13.1
OPENCV_DIR=/opt/opencv/3.0.0
## if commandline --qt-dir
## QT_DIR=from commandline
## fi
## if commandline --adtf-dir
## ADTF_DIR=from commandline
## fi
QMAKE_PATH=$QT_DIR/bin/qmake
if which cmake > /dev/null; then
echo "cmake found"
else
echo "cmake not found. Make sure it's in your PATH."
exit 1
fi
if [ -f $QMAKE_PATH ]; then
echo "qmake found."
else
echo "qmake not found in $QMAKE_PATH. Check the path to Qt or set it as commandline parameter."
exit 1
fi
if [ -d $ADTF_DIR ]; then
echo "ADTF dir found."
else
echo "ADTF dir not found in $ADTF_DIR. Check the path to ADTF or set it as commandline parameter."
exit 1
fi
## if commandline cleanup before build
## rm -rf _build_user
## fi
if [ -d ./build ]; then
echo "Build exists. Will use it."
else
mkdir ./build
echo "Creating build directory."
fi
echo "entering build directory"
cd ./build
echo "generate cmake config"
cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$OPENCV_DIR -DADTF_DIR=$ADTF_DIR -DOPENCV_DIR=$OPENCV_DIR -DQT_QMAKE_EXECUTABLE=$QMAKE_PATH -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
echo "build ..."
cmake --build . --target install --config RelWithDebInfo -- -j4
cd ..