#!/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 } # ----------------------------------------------------------------------------- case "$ParaView_VERSION" in 4* | 5*) if canBuildPlugin then [ -n "$PV_PLUGIN_PATH" ] || { echo "$0 : PV_PLUGIN_PATH not valid - it is unset" exit 1 } # ensure CMake gets the correct C/C++ compilers [ -n "$WM_CC" ] && export CC="$WM_CC" [ -n "$WM_CXX" ] && export CXX="$WM_CXX" 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 else echo "ERROR: ParaView not found in $ParaView_DIR" fi ;; *) echo echo "NOTE: skipping build of ParaView plugin(s)" echo " different version: ParaView_VERSION=$ParaView_VERSION" echo ;; esac #------------------------------------------------------------------------------