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.
34 lines
1.3 KiB
34 lines
1.3 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_FULL_SYSCONFDIR="/$dir_prefix/$dir_sysconfdir" \
|
|
-DCMAKE_INSTALL_FULL_BINDIR="/$dir_prefix/$dir_bindir" \
|
|
-DCMAKE_INSTALL_FULL_SBINDIR="/$dir_prefix/$dir_sbindir" \
|
|
-DCMAKE_INSTALL_FULL_LIBEXECDIR="/$dir_prefix/$dir_libexecdir" \
|
|
-DCMAKE_INSTALL_FULL_LIBDIR="/$dir_prefix/$dir_libdir" \
|
|
-DCMAKE_INSTALL_FULL_INCLUDEDIR="/$dir_prefix/$dir_includedir" \
|
|
-DCMAKE_INSTALL_FULL_DATADIR="/$dir_prefix/$dir_datadir" \
|
|
-DCMAKE_INSTALL_FULL_MANDIR="/$dir_prefix/$dir_mandir" \
|
|
-DCMAKE_INSTALL_FULL_DOCDIR="/$dir_prefix/$dir_docdir/$name" \
|
|
-DCMAKE_INSTALL_FULL_INFODIR="/$dir_prefix/$dir_infodir" \
|
|
-DCMAKE_INSTALL_FULL_LOCALEDIR="/$dir_prefix/$dir_localedir" \
|
|
"$@"
|
|
make
|
|
[ "$noinstall" = false ] && make DESTDIR="$dir_install" install
|
|
cd "$olddir"
|
|
}
|
|
|