From 005eefd46fa214e50c69d070e598da00bb2b5a4b Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sat, 10 Dec 2016 21:31:04 +0100 Subject: [PATCH] Allow custom builddir with compile_cmake --- satellites/functions/compile/cmake.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/satellites/functions/compile/cmake.sh b/satellites/functions/compile/cmake.sh index 5f1ec10..5a2b4a6 100644 --- a/satellites/functions/compile/cmake.sh +++ b/satellites/functions/compile/cmake.sh @@ -1,17 +1,19 @@ compile_cmake() { local olddir="$PWD" + local builddir='build' local noinstall=false local OPTIND=1 local opt - while getopts 'I' opt; do case "$opt" in + 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 build; cd build - cmake .. \ + mkdir -p "$builddir"; cd "$builddir" + cmake "$olddir" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="/$dir_prefix" \ -DCMAKE_INSTALL_SYSCONFDIR="$dir_sysconfdir" \