2012-04-21 18:37:48 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Use this script to build MegaGlest Eclipse project files from CMake
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
|
|
|
|
# Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+
|
|
|
|
|
2013-01-01 23:55:57 +00:00
|
|
|
CURRENTDIR="$(dirname $(readlink -f $0))"
|
2012-04-21 18:37:48 +00:00
|
|
|
mkdir -p eclipse
|
|
|
|
cd eclipse
|
|
|
|
|
|
|
|
if [ -f 'CMakeCache.txt' ]; then rm -f 'CMakeCache.txt'; fi
|
|
|
|
|
2013-01-02 00:13:54 +00:00
|
|
|
LANG=C
|
2013-05-15 05:30:51 +00:00
|
|
|
NUMCORES=`lscpu -p | grep -cv '^#'`
|
|
|
|
if [ "$NUMCORES" = '' ]; then NUMCORES=1; fi
|
2013-01-02 00:13:54 +00:00
|
|
|
|
2012-04-21 18:37:48 +00:00
|
|
|
# This is for regular developers and used by our installer
|
2014-01-21 23:21:56 -08:00
|
|
|
cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_INSTALL_PREFIX= -DWANT_STATIC_LIBS=ON -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-j$NUMCORES ${CURRENTDIR}/../../
|
2012-04-21 18:37:48 +00:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo 'ERROR: CMAKE failed.' >&2; exit 1
|
|
|
|
fi
|
|
|
|
|
2013-01-01 23:55:57 +00:00
|
|
|
cd ${CURRENTDIR}
|
2012-04-21 18:37:48 +00:00
|
|
|
echo ''
|
2013-01-02 00:13:54 +00:00
|
|
|
echo '*** Eclipse Project files [.project and .cproject] can be imported from the folder: [eclipse]'
|
|
|
|
echo 'detected and using: ' $NUMCORES ' cores...'
|
2013-01-01 23:58:47 +00:00
|
|
|
echo 'Import the created project using Menu File->Import'
|
|
|
|
echo 'Select General->Existing projects into workspace:'
|
|
|
|
echo 'Browse where your build tree is ['${CURRENTDIR}'/eclipse] and select the directory.'
|
|
|
|
echo 'Keep "Copy projects into workspace" unchecked.'
|
|
|
|
echo 'You get a fully functional eclipse project'
|
2013-01-01 23:55:57 +00:00
|
|
|
echo ''
|
|
|
|
ls -la eclipse
|