Salome HOME
Improve build scripts for linux
[modules/shaper.git] / make.sh
1 #!/bin/bash
2
3 while [[ $# > 0 ]]; do
4   key="$1"
5
6   case $key in
7     debug|Debug)
8       BUILD_TYPE=Debug
9       shift
10       ;;
11     lcov|coverage)
12       BUILD_TYPE=Debug
13       USE_TEST_COVERAGE=ON
14       shift
15       ;;
16     *)
17       shift
18       ;;
19   esac
20 done
21
22 source env.sh
23
24 CMAKE_ARGS=""
25 CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${BUILD_TYPE:-Release}"
26 CMAKE_ARGS="${CMAKE_ARGS} -DUSE_TEST_COVERAGE=${USE_TEST_COVERAGE:-OFF}"
27 CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${SHAPER_ROOT_DIR}"
28 CMAKE_ARGS="${CMAKE_ARGS} ${SOURCES_DIR}"
29
30 mkdir -p ${BUILD_DIR}
31 cd ${BUILD_DIR}
32
33 set -e
34
35 cmake -G "Unix Makefiles" ${CMAKE_ARGS}
36 make -j$(nproc) install