55root_dir=` pwd`
66build_dir=" $root_dir /_travis/build"
77install_dir=" $root_dir /_travis/install"
8- jrl_mathtools_dir=" $build_dir /jrl-mathtools"
9- jrl_mal_dir=" $build_dir /jrl-mal"
108
119# Shortcuts.
1210git_clone=" git clone --quiet --recursive"
@@ -22,23 +20,22 @@ export LD_LIBRARY_PATH="$install_dir/lib/`dpkg-architecture -qDEB_BUILD_MULTIARC
2220export PKG_CONFIG_PATH=" $install_dir /lib/pkgconfig:$PKG_CONFIG_PATH "
2321export PKG_CONFIG_PATH=" $install_dir /lib/` dpkg-architecture -qDEB_BUILD_MULTIARCH` /pkgconfig:$PKG_CONFIG_PATH "
2422
25- # Retrieve jrl-mathtools
26- echo " --> Compiling jrl-mathtools"
27- cd " $build_dir "
28- $git_clone " git://github.com/jrl-umi3218/jrl-mathtools.git"
29- cd " $jrl_mathtools_dir "
30- cmake . -DCMAKE_INSTALL_PREFIX:STRING=" $install_dir "
31- make install
23+ install_dependency ()
24+ {
25+ echo " --> Compiling $1 "
26+ mkdir -p " $build_dir /$1 "
27+ cd " $build_dir "
28+ $git_clone " git://github.com/$1 " " $1 "
29+ cd " $build_dir /$1 "
30+ cmake . -DCMAKE_INSTALL_PREFIX:STRING=" $install_dir "
31+ make install
32+ }
3233
33- # Retrieve jrl-mal
34- echo " --> Compiling jrl-mal"
35- cd " $build_dir "
36- $git_clone " git://github.com/jrl-umi3218/jrl-mal.git"
37- cd " $jrl_mal_dir "
38- cmake . -DCMAKE_INSTALL_PREFIX:STRING=" $install_dir "
39- make install
34+ # Retrieve jrl-mathtools
35+ install_dependency jrl-umi3218/jrl-mathtools
36+ install_dependency jrl-umi3218/jrl-mal
4037
41- # Compile metapod and run tests
38+ # Compile and run tests
4239cd " $build_dir "
4340cmake " $root_dir " -DCMAKE_INSTALL_PREFIX=" $install_dir " \
4441 -DCMAKE_CXX_FLAGS=" --coverage" \
0 commit comments