|
|
|
compile_cmake() {
|
|
|
|
local olddir="$PWD"
|
|
|
|
local noinstall=false
|
|
|
|
|
|
|
|
local OPTIND=1
|
|
|
|
local opt
|
|
|
|
while getopts 'I' opt; do case "$opt" in
|
|
|
|
I) local noinstall=true ;;
|
|
|
|
esac; done
|
|
|
|
shift $((OPTIND-1))
|
|
|
|
[ "$1" = '--' ] && shift
|
|
|
|
|
|
|
|
mkdir -p build; cd build
|
|
|
|
cmake .. \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="/$dir_prefix" \
|
|
|
|
-DCMAKE_INSTALL_SYSCONFDIR="$dir_sysconfdir" \
|
|
|
|
-DCMAKE_INSTALL_BINDIR="$dir_bindir" \
|
|
|
|
-DCMAKE_INSTALL_SBINDIR="$dir_sbindir" \
|
|
|
|
-DCMAKE_INSTALL_LIBDIR="$dir_libdir" \
|
|
|
|
-DCMAKE_INSTALL_LIBEXECDIR="$dir_libexecdir" \
|
|
|
|
-DCMAKE_INSTALL_DATADIR="$dir_datadir" \
|
|
|
|
-DCMAKE_INSTALL_MANDIR="$dir_mandir" \
|
|
|
|
-DCMAKE_INSTALL_DOCDIR="$dir_docdir" \
|
|
|
|
-DCMAKE_INSTALL_INFODIR="$dir_infodir" \
|
|
|
|
-DCMAKE_INSTALL_LOCALEDIR="$dir_localedir" \
|
|
|
|
"$@"
|
|
|
|
make
|
|
|
|
[ "$noinstall" = false ] && make DESTDIR="$dir_install" install
|
|
|
|
cd "$olddir"
|
|
|
|
}
|