2009-05-28 13:49:12 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
function autocmd()
|
|
|
|
{
|
|
|
|
echo "Running ${1}..."
|
|
|
|
$* || {
|
|
|
|
echo "Error running ${1}"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ ! -d "build" ]; then
|
|
|
|
mkdir build
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd build
|
|
|
|
|
2009-06-01 13:30:54 -04:00
|
|
|
# prefix=`echo $@ | grep -q "--prefix="`
|
|
|
|
#
|
|
|
|
# if $prefix
|
|
|
|
# then options=$@" -DCMAKE_INSTALL_PREFIX="$prefix_env
|
2009-05-28 13:49:12 -04:00
|
|
|
|
2009-06-02 13:41:23 -04:00
|
|
|
# debug=`echo $@ | grep -q "debug"`
|
|
|
|
|
|
|
|
options=`echo $@ | sed "s/--prefix=/-DCMAKE_INSTALL_PREFIX=/g" | sed "s/--with-debug//g"`
|
|
|
|
|
|
|
|
if `echo $@ | grep -q "\--with-debug"`
|
|
|
|
then echo "Enable debug messages"
|
2009-06-04 12:36:01 -04:00
|
|
|
options="$options -DCMAKE_BUILD_TYPE=Debug"
|
2009-06-02 13:41:23 -04:00
|
|
|
else echo "Disable debug messages"
|
2009-06-04 12:36:01 -04:00
|
|
|
options="$options -DCMAKE_BUILD_TYPE=Release"
|
2009-06-02 13:41:23 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Passing argument '$options' to cmake"
|
2009-06-01 13:30:54 -04:00
|
|
|
|
|
|
|
autocmd cmake $options ..
|
|
|
|
|
2009-05-28 13:49:12 -04:00
|
|
|
|
|
|
|
echo "**********************************************"
|
|
|
|
echo "Configuration done!"
|
2009-06-02 13:41:23 -04:00
|
|
|
echo "Run \`cd build' to go to the build directory."
|
|
|
|
echo "Then run \`make'to build the software."
|
2009-05-28 13:49:12 -04:00
|
|
|
echo "**********************************************"
|