2011-05-07 07:48:21 +00:00
|
|
|
#!/bin/bash
|
2011-12-15 18:01:07 +00:00
|
|
|
# Use this script to build MegaGlest using cmake
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
|
|
|
|
# Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+
|
2010-12-11 07:24:03 +00:00
|
|
|
|
2012-07-22 12:31:17 +00:00
|
|
|
LANG=C
|
2011-05-24 22:51:45 +00:00
|
|
|
NUMCORES=`cat /proc/cpuinfo | grep -cE '^processor'`
|
|
|
|
|
2010-12-16 10:52:34 +00:00
|
|
|
mkdir -p build
|
2010-12-11 07:24:03 +00:00
|
|
|
cd build
|
2010-12-11 12:53:38 +00:00
|
|
|
|
2011-10-18 12:36:44 +00:00
|
|
|
if [ -f 'CMakeCache.txt' ]; then rm -f 'CMakeCache.txt'; fi
|
|
|
|
|
2011-05-07 07:48:21 +00:00
|
|
|
# This is for regular developers and used by our installer
|
2012-06-16 06:52:54 +00:00
|
|
|
# For more cmake/build options refer to
|
|
|
|
# http://wiki.megaglest.org/Linux_Compiling#Building_using_CMake_by_Hand
|
2013-02-09 20:45:21 +00:00
|
|
|
# this script looks for google-breakpad in the main root folder, you may link to the real path using:
|
|
|
|
# ln -s ../../google-breakpad/ google-breakpad
|
|
|
|
|
|
|
|
CURRENTDIR="$(dirname $(readlink -f $0))"
|
|
|
|
cmake -DCMAKE_INSTALL_PREFIX='' -DWANT_DEV_OUTPATH=ON -DWANT_STATIC_LIBS=ON -DBREAKPAD_ROOT=${CURRENTDIR}/../google-breakpad/ ..
|
2011-10-18 12:36:44 +00:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo 'ERROR: CMAKE failed.' >&2; exit 1
|
|
|
|
fi
|
|
|
|
|
2011-05-24 22:51:45 +00:00
|
|
|
make -j$NUMCORES
|
2011-10-18 12:36:44 +00:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo 'ERROR: MAKE failed.' >&2; exit 2
|
|
|
|
fi
|
2010-12-11 07:24:03 +00:00
|
|
|
|
2010-12-16 10:52:34 +00:00
|
|
|
cd ..
|
2011-10-18 12:36:44 +00:00
|
|
|
echo ''
|
|
|
|
echo 'BUILD COMPLETE.'
|
|
|
|
echo ''
|
2013-02-09 20:45:21 +00:00
|
|
|
echo 'To build with boogle-breakpad support pass the path to the library as follows:'
|
|
|
|
echo 'cmake -DBREAKPAD_ROOT=/home/softcoder/Code/google-breakpad/'
|
2011-10-18 12:36:44 +00:00
|
|
|
echo 'To launch MegaGlest from the current directory, use:'
|
|
|
|
echo ' mk/linux/megaglest --ini-path=mk/linux/ --data-path=mk/linux/'
|
2012-07-22 12:31:17 +00:00
|
|
|
echo 'Or change into mk/linux and run it from there:'
|
|
|
|
echo ' ./megaglest --ini-path=./ --data-path=./'
|