2017-07-29 21:07:08 +02:00
|
|
|
#!/bin/bash -eu
|
2015-11-12 19:13:54 +01:00
|
|
|
|
2017-08-26 08:00:11 +02:00
|
|
|
: ${CMAKE:=cmake}
|
2017-08-22 06:09:42 +02:00
|
|
|
: ${CHECK:=false}
|
|
|
|
: ${INTEGRATION:=true}
|
|
|
|
|
2017-08-26 08:00:11 +02:00
|
|
|
${CMAKE} --version
|
2017-08-22 06:09:42 +02:00
|
|
|
|
|
|
|
CFG=$*
|
|
|
|
if [[ "$CHECK" == "true" ]]; then
|
|
|
|
CFG="-DLINT=ON $CFG"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if uname -s | grep -q Darwin; then
|
|
|
|
CFG="-DENABLE_NLS=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl $CFG"
|
|
|
|
fi
|
2015-11-12 19:13:54 +01:00
|
|
|
|
2017-07-29 21:07:08 +02:00
|
|
|
if [[ ! -d build ]]
|
2015-11-12 19:13:54 +01:00
|
|
|
then
|
2017-08-22 06:09:42 +02:00
|
|
|
mkdir build
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd build
|
2017-08-26 08:00:11 +02:00
|
|
|
${CMAKE} .. ${CFG}
|
2017-08-22 06:09:42 +02:00
|
|
|
make -j2
|
|
|
|
make test
|
|
|
|
if [[ "$INTEGRATION" == "true" ]]; then
|
|
|
|
make integration
|
2015-11-12 19:13:54 +01:00
|
|
|
fi
|
|
|
|
|
2017-08-22 06:09:42 +02:00
|
|
|
cd ..
|
2017-08-08 17:50:44 +02:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo 'Everything looks good, you can install via "make install -C build".'
|