Salome HOME
PlaneGCS: fix incorrect range of fillet arc on the XZ plane
[modules/shaper.git] / make.sh
diff --git a/make.sh b/make.sh
index f4a94002e273e05fdf0898d09056867d0295e63a..2ebe12011854c06aad3b33df2221ef0d973cc436 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -1,26 +1,46 @@
 #!/bin/bash
 
-# Find absolute path to ROOT_DIR
-export ROOT_DIR=$(pwd)/..
-export ROOT_DIR=`cd "${ROOT_DIR}";pwd`
+source env.sh
 
-SRC_DIR=${ROOT_DIR}/sources
+while [[ $# > 0 ]]; do
+  key="$1"
 
-BUILD_DIR=build
-INSTALL_DIR=install
-if [ $1 ]; then
-  BUILD_DIR=${BUILD_DIR}-$1
-  INSTALL_DIR=${INSTALL_DIR}-$1
+  case $key in
+    debug|Debug)
+      BUILD_TYPE=Debug
+      shift
+      ;;
+    lcov|coverage)
+      BUILD_TYPE=Debug
+      USE_TEST_COVERAGE=ON
+      shift
+      ;;
+    standalone|Standalone)
+      MODE=Standalone
+      shift
+      ;;
+    *)
+      shift
+      ;;
+  esac
+done
+
+if [[ ${MODE} = 'Standalone' ]]; then
+  source ${TOOLS_DIR}/env_standalone.sh
+else
+  source ${TOOLS_DIR}/env_salome.sh
 fi
 
-source ${SRC_DIR}/salome_env.sh
-source ${SRC_DIR}/linux_env.sh $1
-mkdir -p ${ROOT_DIR}/${BUILD_DIR}
-cd ${ROOT_DIR}/${BUILD_DIR}
+CMAKE_ARGS=""
+CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${BUILD_TYPE:-Release}"
+CMAKE_ARGS="${CMAKE_ARGS} -DUSE_TEST_COVERAGE=${USE_TEST_COVERAGE:-OFF}"
+CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${SHAPER_ROOT_DIR}"
+CMAKE_ARGS="${CMAKE_ARGS} ${SOURCES_DIR}"
+
+mkdir -p ${BUILD_DIR}
+cd ${BUILD_DIR}
 
-CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release"
-CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${ROOT_DIR}/${INSTALL_DIR}"
-CMAKE_ARGS="${CMAKE_ARGS} ${SRC_DIR}"
+set -e
 
 cmake -G "Unix Makefiles" ${CMAKE_ARGS}
 make -j$(nproc) install