Salome HOME
GeomAlgoAPI_Transform now derived from GeomAlgoAPI_MakeShape
[modules/shaper.git] / make.sh
diff --git a/make.sh b/make.sh
index d076d44e1fe24b4f6cda466f9ece4e2918a48a06..15b951265c280548253548ee4de85d763d9d6487 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -1,15 +1,46 @@
 #!/bin/bash
 
 source env.sh
-source env_standalone.sh
 
-mkdir -p ${BUILD_DIR}
-cd ${BUILD_DIR}
+while [[ $# > 0 ]]; do
+  key="$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
 
 CMAKE_ARGS=""
-CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release"
-CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_DIR}"
+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=${NEWGEOM_ROOT_DIR}"
 CMAKE_ARGS="${CMAKE_ARGS} ${SOURCES_DIR}"
 
+mkdir -p ${BUILD_DIR}
+cd ${BUILD_DIR}
+
+set -e
+
 cmake -G "Unix Makefiles" ${CMAKE_ARGS}
 make -j$(nproc) install