From cbdbeab047080aec9f89e4fef87723a22adb1abc Mon Sep 17 00:00:00 2001 From: poikilos <7557867+poikilos@users.noreply.github.com> Date: Wed, 28 Aug 2019 16:43:21 -0400 Subject: [PATCH] add MultiCraft build script --- build-MultiCraft.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 build-MultiCraft.sh diff --git a/build-MultiCraft.sh b/build-MultiCraft.sh new file mode 100644 index 0000000..56622e1 --- /dev/null +++ b/build-MultiCraft.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +#two-line version: +# if [! -f CMakeLists.txt ]; then git clone https://github.com/MultiCraft/MultiCraft.git && cd MultiCraft || exit 1; fi +# cmake . -DOpenGL_GL_PREFERENCE=GLVND && make + +me="$0" +customDie() { + echo + echo + echo "$me ERROR:" + echo $1 + echo + exit 1 +} +goodFlagFile=MultiCraft/CMakeLists.txt +if [ -f "`which git`" ]; then + if [ ! -d MultiCraft ]; then + git clone https://github.com/MultiCraft/MultiCraft.git || customDie "Cannot clone MultiCraft from `pwd`" + cd MultiCraft || customDie "Cannot cd MultiCraft from `pwd`" + else + cd MultiCraft || customDie "Cannot cd MultiCraft from `pwd`" + git pull || customDie "Cannot pull MultiCraft from `pwd`" + fi +else + if [ ! -f "$goodFlagFile" ]; then + customDie "You are missing git, and offline install is not possible without in current directory (`pwd`)" + else + cd MultiCraft || customDie "Cannot cd MultiCraft from `pwd`" + fi +fi +srcPath=. +flag1="-DOpenGL_GL_PREFERENCE=GLVND" +echo +echo "Running cmake srcPath..." +cmake $srcPath $flag1 || customDie "cmake failed. See any messages above for more information." +echo +echo "Running make..." +make +echo "Done."