1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-23 00:00:05 +01:00
libhermit/usr/rdma-core/build.sh
2017-10-06 15:13:04 +02:00

31 lines
503 B
Bash
Executable file

#!/bin/bash
set -e
SRCDIR=`dirname $0`
BUILDDIR="$SRCDIR/build"
mkdir -p "$BUILDDIR"
if hash cmake3 2>/dev/null; then
# CentOS users are encouraged to install cmake3 from EPEL
CMAKE=cmake3
else
CMAKE=cmake
fi
if hash ninja-build 2>/dev/null; then
# Fedora uses this name
NINJA=ninja-build
elif hash ninja 2>/dev/null; then
NINJA=ninja
fi
cd "$BUILDDIR"
if [ "x$NINJA" == "x" ]; then
$CMAKE -DIN_PLACE=1 ..
make
else
$CMAKE -DIN_PLACE=1 -GNinja ..
$NINJA
fi