blob: adb949e7c1652af592e21798c9becfe5c569d6a5 [file] [log] [blame]
Austin Schuh70cc9552019-01-21 19:46:48 -08001#!/bin/bash
2
3# Stop processing on any error.
4set -e
5
6function install_if_not_installed() {
7 declare -r formula="$1"
8 if [[ $(brew list ${formula} &>/dev/null; echo $?) -ne 0 ]]; then
9 brew install ${formula}
10 else
11 echo "$0 - ${formula} is already installed."
12 fi
13}
14
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080015# Manually trigger an update prior to installing packages to avoid Ruby
16# version related errors as per [1].
17#
18# [1]: https://github.com/travis-ci/travis-ci/issues/8552
19brew update
20
Austin Schuh70cc9552019-01-21 19:46:48 -080021install_if_not_installed cmake
22install_if_not_installed glog
23install_if_not_installed gflags
24install_if_not_installed eigen
25install_if_not_installed suite-sparse