#!/bin/sh
cd "${0%/*}" || exit                                # Run from this directory
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions  # Require wmake functions
. ${WM_PROJECT_DIR:?}/wmake/scripts/paraviewFunctions # For API info
# -----------------------------------------------------------------------------

get_pvplugin_api || echo "No ParaView plugin information found" 1>&2

# Cleanup libraries
wclean libso common
wclean libso blockMeshReader/library
wclean libso foamReader/library

# Cleanup client-server and/or combined plugins
if [ -d "$FOAM_PV_PLUGIN_LIBBIN" ]
then
    echo "Old plugins dir : $FOAM_PV_PLUGIN_LIBBIN"
    # rm -rf "$FOAM_PV_PLUGIN_LIBBIN"
fi

# Cleanup generated files - remove entire top-level
removeObjectDir "$PWD"

#------------------------------------------------------------------------------
