forked from vfxpro99/usd-build-club
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-macos.sh
executable file
·118 lines (96 loc) · 3.16 KB
/
build-macos.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/bash
# optional first argument: Debug
PREREQ_SCRIPTDIR=`dirname $0`
ROOT=$(pwd)
echo "-------------------------------------------------"
echo "1/7 Validating cmake and brew"
echo "-------------------------------------------------"
PATH=$ROOT/local/bin:$PATH
if hash cmake 2>/dev/null; then
echo "cmake up to date"
else
echo "Please install cmake and run this script again."
echo "cmake can be installed via homebrew"
echo "brew install cmake"
exit 1
#$PREREQ_SCRIPTDIR/prerequisites-macos/cmake.sh $ROOT/local
fi
PYTHONPATH=$ROOT/local/lib/python2.7/site-packages:$PYTHONPATH
echo "-------------------------------------------------"
echo "2/7 PySide for usdview"
echo "-------------------------------------------------"
if hash qmake 2>/dev/null; then
echo "qmake found, if PySide exists, usdview will be built"
else
echo "Usdview uses PySide. PySide needs qmake in the path. qmake comes from Qt"
echo "One way to get it is via homebrew:"
echo ""
echo "brew install cartr/qt4/qt"
echo "brew install cartr/qt4/pyside"
echo "brew install cartr/qt4/pyside-tools"
echo ""
echo "qmake typically appears in /usr/local/Cellar/qt4/4.8.7/bin"
fi
echo "-------------------------------------------------"
echo "3/7 Building Prerequsities for USD"
echo "-------------------------------------------------"
$PREREQ_SCRIPTDIR/build-prerequisites-macos.sh $ROOT/local
rc=$?
if [ $rc -ne 0 ]; then
echo "Failed to build prerequisites, exiting"
exit $rc
fi
echo "-------------------------------------------------"
echo "4/7 Getting the latest USD dev code"
echo "-------------------------------------------------"
if [ ! -f ../USD/.git/config ]; then
cd ..
git clone https://github.com/PixarAnimationStudios/USD.git
fi
cd "$ROOT/../USD"
git checkout dev
git pull
cd "$ROOT"
echo "-------------------------------------------------"
echo "5/7 Configuring an Xcode build for USD"
echo "-------------------------------------------------"
BUILDDIR="$ROOT/local"
cmake ../USD \
-DCMAKE_INSTALL_PREFIX="${BUILDDIR}" \
-DCMAKE_PREFIX_PATH="${BUILDDIR}" \
-DALEMBIC_DIR="${BUILDDIR}" \
-DDOUBLE_CONVERSION_DIR="${BUILDDIR}" \
-DGLEW_LOCATION="${BUILDDIR}" \
-DOIIO_LOCATION="${BUILDDIR}" \
-DOPENEXR_ROOT_DIR="${BUILDDIR}" \
-DOPENSUBDIV_ROOT_DIR="${BUILDDIR}" \
-DPTEX_LOCATION="${BUILDDIR}" \
-DTBB_ROOT_DIR="${BUILDDIR}" \
-DBoost_INCLUDE_DIR="${BUILDDIR}/include" \
-DBoost_LIBRARY_DIR="${BUILDDIR}/lib" \
-DQT_ROOT_DIR="$ROOT/homebrew" \
-G Xcode
rc=$?
if [ $rc -ne 0 ]; then
echo "Failed to configure build for Xcode, exiting"
exit $rc
fi
echo "-------------------------------------------------"
echo "6/7 Building and installing USD"
if [[ "$1" = "Debug" ]]; then
echo " Debug build in progress."
cmake --build . --target install --config Debug
else
echo " Release build in progress."
cmake --build . --target install --config Release
fi
echo "-------------------------------------------------"
rc=$?
if [ $rc -ne 0 ]; then
echo "Failed to build USD, exiting"
exit $rc
fi
echo "-------------------------------------------------"
echo "7/7 Finalizing the build"
echo "-------------------------------------------------"
# currently nothing to do