You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.1 KiB
33 lines
1.1 KiB
compile_cmake() {
|
|
local olddir="$PWD"
|
|
local builddir='build'
|
|
local noinstall=false
|
|
|
|
local OPTIND=1
|
|
local opt
|
|
while getopts 'b:I' opt; do case "$opt" in
|
|
b) local builddir="$OPTARG" ;;
|
|
I) local noinstall=true ;;
|
|
esac; done
|
|
shift $((OPTIND-1))
|
|
[ "$1" = '--' ] && shift
|
|
|
|
mkdir -p "$builddir"; cd "$builddir"
|
|
cmake "$olddir" \
|
|
-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/$name" \
|
|
-DCMAKE_INSTALL_INFODIR="$dir_infodir" \
|
|
-DCMAKE_INSTALL_LOCALEDIR="$dir_localedir" \
|
|
"$@"
|
|
make
|
|
[ "$noinstall" = false ] && make DESTDIR="$dir_install" install
|
|
cd "$olddir"
|
|
}
|
|
|