#!/bin/bash
set -e
info() { echo -e "\033[1;34m[INFO ][Depend ] $1\033[1;37m" ; }
warn() { echo >&2 -e "\033[1;31m[WARN ][Depend ] $1\033[1;37m" ; }
fileName="pybind11"
packageFQDN="pybind11/pybind11@2.6.2"
packageName="pybind11"
cd "$fileName" || {
warn "cd to ./opensource/${fileName} failed"
exit 254
}
info "Building dependency: $packageFQDN."
if [[ -d "./build" ]];then
rm -r ./build
fi
mkdir build
cd build || {
warn "PyBind needs a separate directory for building"
exit 253
}
cmake \
-DCMAKE_INSTALL_PREFIX="$(pwd)/../../tmp/$packageName" \
-DPYBIND11_TEST=OFF \
-G "Unix Makefiles" .. || {
warn "Building $packageFQDN failed during cmake"
exit 254
}
make -j12 || {
warn "Building $packageFQDN failed during make"
exit 254
}
make install -j || {
warn "Building $packageFQDN failed during make install"
exit 254
}
cd ../..
info "Build $packageFQDN done."