#!/bin/bash
cd ${0%/*} || exit 1 # run from this directory
if [ "$PWD" != "$WM_PROJECT_DIR" ]
then
echo
echo "Error: Current directory is not \$WM_PROJECT_DIR"
echo " The environment variables are not consistent with the installation."
echo " Please source configuration files."
echo "Examples:"
echo " bash: . etc/bashrc"
echo " tcsh: source etc/cshrc"
echo " If you sourced the configuration files, please check the 'foamInstall' entry."
exit 1
fi
if [ -z "$PARAVIEW_SYSTEM" ] && [ -z "$QT_BIN_DIR" ]
echo "\$QT_BIN_DIR not set. To compile Paraview from sources"
echo "the command \$QT_BIN_DIR/qmake needs to be valid."
echo "Examples: "
echo " Ubuntu: \"export QT_BIN_DIR=/usr/bin\""
echo " Fedora: \"export QT_BIN_DIR=????\""
echo " openSuse: \"export QT_BIN_DIR=????\""
read -r -p "Proceed without compiling ParaView [Y/n] " response
if [[ $response =~ ^([nN][oO]|[nN])$ ]]
exit 0
# wmake is required for subsequent targets
( cd wmake/src && make )
# build ThirdParty sources
( cd $WM_THIRD_PARTY_DIR && ./AllMake.pre )
# We make sure the ThirdParty packages environment variables are up-to-date
# before compiling the rest of OpenFOAM
. $WM_PROJECT_DIR/etc/settings.sh
# build OpenFOAM libraries and applications
src/Allwmake
applications/Allwmake
if [ "$1" = doc ]
doc/Allwmake
# build ThirdParty sources that depend on main installation
( cd $WM_THIRD_PARTY_DIR && ./AllMake.post )
# ----------------------------------------------------------------- end-of-file