if [ "$SAGE_LOCAL" = "" ]; then
   echo "SAGE_LOCAL undefined ... exiting";
   echo "Maybe run 'sage -sh'?"
   exit 1
fi

cd src/

cmake -DCMAKE_INSTALL_PREFIX="${SAGE_LOCAL}" -DCMAKE_VERBOSE_MAKEFILE=ON

sdh_make

# clean old install
rm -rf "${SAGE_LOCAL}"/include/libqhull
rm -rf "${SAGE_LOCAL}"/include/qhull
rm -rf "${SAGE_LOCAL}"/lib/libqhull*

sdh_make_install
