forked from torrvision/spaint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-win.sh
executable file
·49 lines (38 loc) · 1.21 KB
/
build-win.sh
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
45
46
47
48
49
#! /bin/bash -e
# Check that valid parameters have been specified.
if [ $# -ne 2 ] || ([ "$1" != "11" ] && [ "$1" != "12" ] && [ "$1" != "14" ] && [ "$1" != "15" ]) || ([ "$2" != "Debug" ] && [ "$2" != "Release" ])
then
echo "Usage: build-win.sh {11|12|14|15} {Debug|Release}"
exit
fi
# Check that msbuild is on the system path.
./require-msbuild.sh
# Build the third-party libraries.
cd libraries
./build-boost_1_58_0-win.sh "$1"
./build-glew-1.12.0-win.sh "$1"
./build-lodepng-20160501-win.sh "$1"
#./build-opencv-3.1.0-win.sh "$1"
./build-SDL2-2.0.7-win.sh "$1"
./extract-Eigen-3.2.2.sh
cd ..
# Build spaint itself.
echo "[spaint] Building spaint"
if [ ! -d build ]
then
mkdir build
cd build
# Note: We need to configure twice to handle conditional building.
echo "[spaint] ...Configuring using CMake..."
CMAKE_GENERATOR=`../determine-cmakegenerator.sh $1`
VS_TOOLSET_STRING=`../determine-vstoolsetstring.sh $1`
cmake -G "$CMAKE_GENERATOR" $VS_TOOLSET_STRING ..
cmake ..
cd ..
fi
cd build
echo "[spaint] ...Running build..."
cmd //c "msbuild /p:Configuration=$2 spaint.sln"
echo "[spaint] ...Installing..."
cmd //c "msbuild /p:Configuration=$2 INSTALL.vcxproj"
echo "[spaint] ...Finished building spaint."