openfoam/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
2016-10-07 10:51:32 +02:00

73 lines
1.7 KiB
Bash
Executable File

#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Optional unit: continue-on-error
export WM_CONTINUE_ON_ERROR=true
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
#
# There are several prerequisites for building a plugin
#
#set -x
canBuildPlugin()
{
[ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] || {
echo
echo "WARNING: cannot build ParaView plugin(s) without paraview directory"
echo " ParaView_DIR=$ParaView_DIR"
echo
return 1
}
[ -n "$PV_PLUGIN_PATH" ] || {
echo
echo "${PWD##*/} : invalid PV_PLUGIN_PATH for building ParaView plugin(s)"
echo " PV_PLUGIN_PATH=${PV_PLUGIN_PATH:-unset}"
echo
return 1
}
type cmake > /dev/null 2>&1 || {
echo
echo "WARNING: cannot build ParaView plugin(s) without cmake"
echo
return 1
}
return 0 # success
}
# -----------------------------------------------------------------------------
# major version as per paraview include directory:
# Eg, "PREFIX/include/paraview-5.0" -> "5.0"
major="${ParaView_INCLUDE_DIR##*-}"
case "$major" in
[45].[0-9]*)
if canBuildPlugin
then
(
wmake $targetType vtkPVReaders
PVblockMeshReader/Allwmake $targetType $*
PVFoamReader/Allwmake $targetType $*
# Dummy directory to trigger proper 'wclean all' behaviour
# - the Allwclean will otherwise not be used
mkdir -p Make
)
fi
;;
*)
echo
echo "NOTE: skipping build of ParaView plugin(s)"
echo " include directory was for paraview major version '${major:-none}'"
echo
;;
esac
#------------------------------------------------------------------------------