2015-11-11 14:30:00 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2015-11-11 15:12:19 +01:00
|
|
|
LANGUAGE=$1
|
|
|
|
|
|
2015-11-11 14:31:32 +01:00
|
|
|
PATH=$PATH:/opt/local/bin
|
|
|
|
|
export PATH
|
2015-11-11 14:30:00 +01:00
|
|
|
|
2015-11-11 15:12:19 +01:00
|
|
|
OPTIONS=""
|
|
|
|
|
|
|
|
|
|
if [ "$LANGUAGE" == "C++98" ]; then
|
|
|
|
|
echo "Building with C++98";
|
|
|
|
|
elif [ "$LANGUAGE" == "C++11" ]; then
|
|
|
|
|
echo "Building with C++11";
|
|
|
|
|
OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++11' "
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
2015-11-11 14:30:00 +01:00
|
|
|
#########################################
|
|
|
|
|
# Build release version
|
|
|
|
|
#########################################
|
|
|
|
|
|
|
|
|
|
if [ ! -d build-release ]; then
|
|
|
|
|
mkdir build-release
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cd build-release
|
|
|
|
|
|
2015-11-11 15:12:19 +01:00
|
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE $OPTIONS ../
|
2015-11-11 14:30:00 +01:00
|
|
|
|
|
|
|
|
#build it
|
|
|
|
|
make
|
|
|
|
|
|
|
|
|
|
#build the unit tests
|
|
|
|
|
make unittests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#########################################
|
|
|
|
|
# Run Release Unittests
|
|
|
|
|
#########################################
|
|
|
|
|
cd Unittests
|
|
|
|
|
|
|
|
|
|
#execute tests
|
|
|
|
|
./unittests --gtest_color=yes --gtest_output=xml
|
|
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#########################################
|
|
|
|
|
# Build Debug version and Unittests
|
|
|
|
|
#########################################
|
|
|
|
|
|
|
|
|
|
if [ ! -d build-debug ]; then
|
|
|
|
|
mkdir build-debug
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cd build-debug
|
|
|
|
|
|
2015-11-11 15:12:19 +01:00
|
|
|
cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE $OPTIONS ../
|
2015-11-11 14:30:00 +01:00
|
|
|
|
|
|
|
|
#build the unit tests
|
|
|
|
|
make unittests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#########################################
|
|
|
|
|
# Run Debug Unittests
|
|
|
|
|
#########################################
|
|
|
|
|
|
|
|
|
|
cd Unittests
|
|
|
|
|
|
|
|
|
|
# Run the unittests
|
|
|
|
|
./unittests --gtest_color=yes --gtest_output=xml
|
|
|
|
|
|
|
|
|
|
|