Salome HOME
Sketch shape in plane selection filter should not be activated while PartSet_WidgetSh...
[modules/shaper.git] / make.sh
diff --git a/make.sh b/make.sh
index 258cc11919584e96d119ada589f6a97c3082eec8..eb82fb25c014c4661c798935de644b7d1dbd07e2 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -1,27 +1,41 @@
 #!/bin/bash
 
-# Find absolute path to ROOT_DIR
-export ROOT_DIR=$(pwd)/..
-export ROOT_DIR=`cd "${ROOT_DIR}";pwd`
+while [[ $# > 0 ]]; do
+  key="$1"
 
-SRC_DIR=${ROOT_DIR}/sources
+  case $key in
+    debug|Debug)
+      BUILD_TYPE=Debug
+      shift
+      ;;
+    lcov|coverage)
+      BUILD_TYPE=Debug
+      USE_TEST_COVERAGE=ON
+      shift
+      ;;
+    models|test-models)
+      ADD_MODELS_TESTS=TRUE
+      shift
+      ;;
+    *)
+      shift
+      ;;
+  esac
+done
 
-BUILD_DIR=build
-INSTALL_DIR=install
-if [ $1 ]; then
-  BUILD_DIR=${BUILD_DIR}-$1
-  INSTALL_DIR=${INSTALL_DIR}-$1
-fi
+source env.sh
 
-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} -DADD_MODELS_TESTS=${ADD_MODELS_TESTS:-FALSE}"
+CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${SHAPER_ROOT_DIR}"
+CMAKE_ARGS="${CMAKE_ARGS} ${SOURCES_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}"
+mkdir -p ${BUILD_DIR}
+cd ${BUILD_DIR}
+
+set -e
 
 cmake -G "Unix Makefiles" ${CMAKE_ARGS}
-make -j4
-make install
+make -j$(nproc) install