#!/bin/sh set -e OS=$(uname -s) case $OS in Linux) mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .. make VERBOSE=1 make VERBOSE=1 test sudo make VERBOSE=1 install cd .. ;; Darwin) # forcing brew versions (of gettext) over Mac versions export CFLAGS=-I/usr/local export CXXFLAGS=-I/usr/local export LDFLAGS=-L/usr/local/lib mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -G Xcode .. xcodebuild -configuration Release -target ALL_BUILD xcodebuild -configuration Release -target RUN_TESTS sudo xcodebuild -configuration Release -target install cd .. ;; *) echo "ERROR: unknown operating system '$OS'." ;; esac