Skip to content

Commit fa55373

Browse files
[travis] Enhance build script
1 parent cb37500 commit fa55373

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

.travis/build

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ set -ev
55
root_dir=`pwd`
66
build_dir="$root_dir/_travis/build"
77
install_dir="$root_dir/_travis/install"
8-
jrl_mathtools_dir="$build_dir/jrl-mathtools"
9-
jrl_mal_dir="$build_dir/jrl-mal"
108

119
# Shortcuts.
1210
git_clone="git clone --quiet --recursive"
@@ -22,23 +20,22 @@ export LD_LIBRARY_PATH="$install_dir/lib/`dpkg-architecture -qDEB_BUILD_MULTIARC
2220
export PKG_CONFIG_PATH="$install_dir/lib/pkgconfig:$PKG_CONFIG_PATH"
2321
export 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
4239
cd "$build_dir"
4340
cmake "$root_dir" -DCMAKE_INSTALL_PREFIX="$install_dir" \
4441
-DCMAKE_CXX_FLAGS="--coverage" \

0 commit comments

Comments
 (0)