blob: adb949e7c1652af592e21798c9becfe5c569d6a5 [file] [log] [blame]
# Stop processing on any error.
set -e
function install_if_not_installed() {
declare -r formula="$1"
if [[ $(brew list ${formula} &>/dev/null; echo $?) -ne 0 ]]; then
brew install ${formula}
echo "$0 - ${formula} is already installed."
# Manually trigger an update prior to installing packages to avoid Ruby
# version related errors as per [1].
# [1]:
brew update
install_if_not_installed cmake
install_if_not_installed glog
install_if_not_installed gflags
install_if_not_installed eigen
install_if_not_installed suite-sparse