summaryrefslogtreecommitdiff
path: root/build-cmake.sh
blob: 154bb870ab60f8aba26b3f1a9e2117fcb775b272 (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
42
43
44
#!/bin/bash -ex
# Download & build cmake on the local machine
# works on Linux, OSX, and Windows (Git Bash)
# leaves output in /tmp/cmake-build/install/
# cmake must be installed on Windows

PROJ=cmake
VER=3.2.3
MSVS=2013

source $(dirname "$0")/build-common.sh build-common.sh

case "$OS" in
windows)
	# wasted a lot of time trying to get it building on windows
	# makefile building didn't work, maybe I should use devenv building
	# just copy the binary release into the install location
	#ZIP=$PROJ-$VER-win32-x86.zip
	#curl -L http://www.cmake.org/files/v3.2/$ZIP -o $ZIP
	#unzip $ZIP
	#mv $PROJ-$VER-win32-x86/* $INSTALL
	ZIP=$PROJ-$VER.zip  # has \r\n line feeds
	#curl http://www.cmake.org/files/v3.2/$ZIP -o $ZIP
	#unzip $ZIP
	TGZ=$PROJ-$VER.tar.gz  # has \n line feeds
	curl -L http://www.cmake.org/files/v3.2/$TGZ -o $TGZ
	tar xzf $TGZ
	mkdir $RD/build
	cd $RD/build
	cmake "$(cygpath -w $RD/$PROJ-$VER)"
	;;
*)
	TGZ=$PROJ-$VER.tar.gz  # has \n line feeds
	curl -L http://www.cmake.org/files/v3.2/$TGZ -o $TGZ
	tar xzf $TGZ
	mkdir $RD/build
	cd $RD/build
	$RD/$PROJ-$VER/configure --prefix=$INSTALL
	make -j$CORES
	make install
	;;
esac

commit_and_push