forked from codebot/middleware_olympics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile.sh
executable file
·42 lines (36 loc) · 962 Bytes
/
compile.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
#!/bin/bash
set -o errexit
if [ $# -lt 1 ]; then
echo "usage: compile.sh MIDDLEWARE_NAME"
echo " example: compile.sh ros1"
exit
fi
MIDDLEWARE_NAME=$1
if [ $MIDDLEWARE_NAME = ros1 ]; then
echo "Building the ROS 1 contestants..."
mkdir -p build/ros1/src
ln -sf `pwd`/ros1/ros1_contestant build/ros1/src
cd build/ros1
source /opt/ros/melodic/setup.bash
catkin build
elif [ $MIDDLEWARE_NAME = ros2 ]; then
echo "Building the ROS 2 contestants...."
mkdir -p build/ros2/src
ln -sf `pwd`/ros2/ros2_contestant build/ros2/src
cd build/ros2
source /opt/ros/eloquent/setup.bash
colcon build
elif [ $MIDDLEWARE_NAME = zenoh ]; then
echo "Building the Zenoh contestants..."
mkdir -p build/zenoh
if [ ! -d build/zenoh/zenoh_contestant ]; then
ln -s `pwd`/zenoh/zenoh_contestant build/zenoh
fi
cd build/zenoh/zenoh_contestant
mkdir -p build
cd build
cmake ..
make
else
echo "unknown middleware: $MIDDLEWARE_NAME"
fi