summaryrefslogtreecommitdiff
path: root/dist/travis/script.sh
blob: 55c689091c2f87b6fbd72d9f2f00bb389004ecae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh

set -e

OS=$(uname -s)

case $OS in
	Linux)
		mkdir build
		cd build
		cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release \
			-DLIB_INSTALL_DIR=lib -DCMAKE_CXX_FLAGS=-g \
			..
		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_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release \
			-DCMAKE_CXX_FLAGS=-g -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