forked from david-cattermole/cameraInferno-maya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_package.bash
66 lines (56 loc) · 1.89 KB
/
build_package.bash
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
#!/usr/bin/env bash
#
# Copyright (C) 2021 David Cattermole.
#
# This file is part of mmSolver.
#
# mmSolver is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# mmSolver is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with mmSolver. If not, see <https://www.gnu.org/licenses/>.
# ---------------------------------------------------------------------
#
# Builds the Camera Inferno Solver project.
# Where to install the module?
#
# The "$HOME/maya/2022/modules" directory is automatically searched
# for Maya module (.mod) files. Therefore we can install directly.
#
INSTALL_MODULE_DIR=${HOME}/maya/2022/modules
# Do not edit below, unless you know what you're doing.
###############################################################################
# Clear all build information before re-compiling.
# Turn this off when wanting to make small changes and recompile.
FRESH_BUILD=1
# Build ZIP Package.
BUILD_PACKAGE=1
# Store the current working directory, to return to.
CWD=`pwd`
# Path to this script.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# The root of this project.
PROJECT_ROOT=`readlink -f ${DIR}/..`
# Build mmSolver project
mkdir -p build_unix
cd build_unix
if [ ${FRESH_BUILD} -eq 1 ]; then
rm --force -R *
fi
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_MODULE_DIR} ..
make clean
make
make install
# Build ZIP package.
if [ ${BUILD_PACKAGE} -eq 1 ]; then
make package
fi
# Return back to project root directory.
cd ${CWD}