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" \