X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=make.sh;h=2ebe12011854c06aad3b33df2221ef0d973cc436;hb=eccac3c539c8b251fae821e616ae6006aef5a8b7;hp=45d88f5a1886ea3e968cfb1a82cc53da4cd4f3f8;hpb=9c5e18da93c3ee4bfeb19ee63c0c3c4540017630;p=modules%2Fshaper.git diff --git a/make.sh b/make.sh index 45d88f5a1..2ebe12011 100755 --- a/make.sh +++ b/make.sh @@ -1,18 +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" -source ${SRC_DIR}/linux_env.sh -mkdir -p ${ROOT_DIR}/build -cd ${ROOT_DIR}/build + 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 -CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Debug" -CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${ROOT_DIR}/install" -CMAKE_ARGS="${CMAKE_ARGS} ${SRC_DIR}" +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=${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} + +set -e cmake -G "Unix Makefiles" ${CMAKE_ARGS} -make -make install +make -j$(nproc) install