Permalink
Fetching contributors…
Cannot retrieve contributors at this time
executable file 72 lines (64 sloc) 2.42 KB
#!/bin/sh
# Internal variables.
alnum=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
CMAKEFLAGS=
srcdir=".."
builddir="build"
# Get command line options. We use getopt to "break them down into nice, digestible particles".
set -- `getopt -u -l "all,srcdir:,builddir:,prefix:,eprefix:,bindir:,sbindir:,libexecdir:,sysconfdir:,libdir:,includedir:,oldincludedir:,datarootdir:,datadir:,infodir:,localedir:,mandir:,docdir:,htmldir:,dvidir:,pdfdir:,psdir:,quiet,silent,version,help,run" hVqn "$@"`
test $# -lt 1 && exit 1
while test $# -gt 0
do
case "$1" in
-h|--help) break;;
-V|--version) cmake --version; exit;;
--builddir) builddir="$2"; shift;;
--srcdir) srcdir="$2"; shift;;
--prefix) prefix="$2"; shift;;
--bindir) bindir="$2"; shift;;
--libdir) libdir="$2"; shift;;
--includedir) includedir="$2"; shift;;
--all) all="y";;
--) shift; break;;
esac
shift
done
# Set up CMake flags.
# Set prefix
if test -n "$prefix"; then
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_INSTALL_PREFIX:PATH=$prefix"
fi
# Set bindir.
if test -n "$bindir"; then
CMAKEFLAGS="$CMAKEFLAGS -DBIN_INSTALL_DIR:PATH=$bindir"
fi
# Set libdir.
if test -n "$libdir"; then
CMAKEFLAGS="$CMAKEFLAGS -DLIB_INSTALL_DIR:PATH=$libdir"
fi
# Set includedir.
if test -n "$includedir"; then
CMAKEFLAGS="$CMAKEFLAGS -DINCLUDE_INSTALL_DIR:PATH=$includedir"
fi
if test -n "$all"; then
CMAKEFLAGS="$CMAKEFLAGS "
fi
# print info.
echo ""
echo "Elektra uses the CMake (http://www.cmake.org) buildsystem instead of configure."
echo "CMake uses different options than configure, but some have direct equivalents:"
echo " --srcdir=<dir> : the top level source directory"
echo " --builddir=<dir> : the directory where Elektra is build"
echo " --prefix=<dir> : -DCMAKE_INSTALL_PREFIX:PATH=<dir>"
echo " --bindir=<dir> : -DBIN_INSTALL_DIR:PATH=<dir>"
echo " --includedir=<dir> : -DINCLUDE_INSTALL_DIR:PATH=<dir>"
echo " --libdir=<dir> : -DLIB_INSTALL_DIR:PATH=<dir>"
echo "Once CMake has run successfully, you can use \"make edit_cache\" to view and modify all settings."
echo ""
echo "To configure all parts on a Debian system, see scripts/configure-debian"
echo ""
echo "Your current configure options translate more or less to:"
echo " mkdir -p $builddir; cd $builddir; cmake$CMAKEFLAGS $srcdir"
echo ""
echo "After configuration, you have to issue following command in $builddir"
echo " make -j5; make install"