-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.sh
executable file
·52 lines (42 loc) · 1.5 KB
/
build.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
#!/bin/bash
# List of catkin packages to build
# Order can be important
PACKAGES=("syllo" "input" "videoray" "syllo_rqt" "blueview" "sandbox" "syllo_uwsim" "underwater")
# Generate setenv.sh file on every build
ENV_FILE_NAME="./setenv.sh"
touch ${ENV_FILE_NAME}
chmod +x ${ENV_FILE_NAME}
ENV_FILE="$(readlink -f ${ENV_FILE_NAME})"
THIS_FILE="$(readlink -f ./build.sh)"
echo "#!/bin/bash" > ${ENV_FILE}
echo "# DO NOT EDIT THIS FILE" >> ${ENV_FILE}
echo "# Automatically generated from:" >> ${ENV_FILE}
echo "# ${THIS_FILE}" >> ${ENV_FILE}
echo "" >> ${ENV_FILE}
# Descend into each catkin package and build it
for i in "${PACKAGES[@]}"
do
:
pushd "./src/${i}/catkin_ws" >& /dev/null
# Build the project
./build.sh
# Source the setup.bash script for this project for later projects
# that will require the current project
PKG_ENV_FILE="$(readlink -f ./devel/setup.bash)"
source "${PKG_ENV_FILE}"
# Add the source line to the high-level setenv.sh script
echo "source ${PKG_ENV_FILE}" >> ${ENV_FILE}
popd >& /dev/null
done
# Add location of Gazebo models
#echo 'export GAZEBO_MODEL_PATH=~/repos/humans/src/underwater/catkin_ws/src:${GAZEBO_MODEL_PATH}' >> ${ENV_FILE}
echo
echo "=================================================="
echo " Add the following lines to your .bashrc file "
echo "=================================================="
echo
echo "CATKIN_WS1_SETUP="${ENV_FILE}
echo 'if [ -f ${CATKIN_WS1_SETUP} ]; then'
echo 'source ${CATKIN_WS1_SETUP}'
echo 'fi'
echo