diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwclean b/applications/utilities/postProcessing/graphics/PVReaders/Allwclean
index df49bb9d24a1dd583634588c84c4a2f83581a283..fed57adbddba35869161ab481a23c5fcad051b88 100755
--- a/applications/utilities/postProcessing/graphics/PVReaders/Allwclean
+++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwclean
@@ -1,7 +1,10 @@
 #!/bin/sh
 cd ${0%/*} || exit 1                                # 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 foamPv
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
index e7c25a10497383f2ae4974166f10e5079d1467a7..4e9cccfdb6a55d84dfe91457b1bce4e81d1b9f38 100755
--- a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
+++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
@@ -19,7 +19,7 @@ then
     wmakeLibPv blockMeshReader/library
     wmakeLibPv foamReader/library
 
-    unset cmakeType
+    unset cmakeOpts cmakeType
 
     if [ "$targetType" != objects ]
     then
@@ -36,8 +36,8 @@ then
 
     if [ -n "$cmakeType" ]
     then
-        "$cmakeType" $PWD/blockMeshReader || warnIncomplete "blockMesh"
-        "$cmakeType" $PWD/foamReader || warnIncomplete "OpenFOAM"
+        "$cmakeType" $PWD/blockMeshReader "$cmakeOpts" || warnIncomplete "blockMesh"
+        "$cmakeType" $PWD/foamReader "$cmakeOpts" || warnIncomplete "OpenFOAM"
     fi
 )
 fi
diff --git a/wmake/scripts/paraviewFunctions b/wmake/scripts/paraviewFunctions
index c545681870e1f9f6f6d12650fc58f1536fbb7a15..94a82e5624ae546eb99519b6e4796304523a2bb6 100644
--- a/wmake/scripts/paraviewFunctions
+++ b/wmake/scripts/paraviewFunctions
@@ -23,7 +23,7 @@
 #     PV_PLUGIN_PATH
 #
 # Provides Functions
-#     have_pvplugin_support, no_paraview, echo_paraview
+#     get_pvplugin_api, have_pvplugin_support, no_paraview, echo_paraview
 #     cmakeVtk, cmakePv, cmakePvInstall
 #
 # Variables on success
@@ -106,6 +106,39 @@ wmakeLibPv()
 }
 
 
+# Extract ParaView plugin api number from PV_PLUGIN_PATH
+# On success, return 0 and export variables
+# -> FOAM_PV_PLUGIN_LIBBIN, PARAVIEW_API
+#
+get_pvplugin_api()
+{
+    # OK
+    unset FOAM_PV_PLUGIN_LIBBIN  PARAVIEW_API
+    local pv_api targetDir
+
+    # The OpenFOAM plugin must be the first in PV_PLUGIN_PATH
+    # and must have the paraview major+minor version encoded in its name!
+    # Eg, PV_PLUGIN_PATH="$FOAM_LIBBIN/paraview-5.5"
+
+    # Get the first entry from PV_PLUGIN_PATH=dir1;dir2;...
+    targetDir="${PV_PLUGIN_PATH##;}"
+    targetDir="${targetDir%%;*}"
+
+    # Extract paraview major+minor version from the directory name
+    # From /path/paraview-5.6 -> 5.6
+    pv_api=$(echo "$targetDir" | \
+        sed -ne 's@^.*/@@;s/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/p')
+
+    [ -n "$pv_api" ] || return 1
+
+    # OK
+    export FOAM_PV_PLUGIN_LIBBIN="$targetDir"
+    export PARAVIEW_API="$pv_api"
+
+    return 0 # success
+}
+
+
 # Test if a ParaView plugin can be built.
 # On success, return 0 and export variables
 # -> HAVE_PVPLUGIN_SUPPORT, FOAM_PV_PLUGIN_LIBBIN,
@@ -124,30 +157,19 @@ have_pvplugin_support()
         return 1
     }
 
+    if get_pvplugin_api
+    then
+        targetDir="$FOAM_PV_PLUGIN_LIBBIN"
+        pv_api="$PARAVIEW_API"
+    fi
+    unset FOAM_PV_PLUGIN_LIBBIN PARAVIEW_API
 
-    # The OpenFOAM plugin must be the first in PV_PLUGIN_PATH
-    # and must have the paraview major+minor version encoded in its name!
-    # Eg, PV_PLUGIN_PATH="$FOAM_LIBBIN/paraview-5.5"
-
-    # Get the first entry from PV_PLUGIN_PATH=dir1;dir2;...
-    targetDir="${PV_PLUGIN_PATH##;}"
-    targetDir="${targetDir%%;*}"
-
-    # Extract the paraview major+minor version from the directory name
-    # From /path/paraview-5.6 -> 5.6
-    pv_api=$(echo "$targetDir" | \
-        sed -ne 's@^.*/@@;s/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/p')
-
-    [ -n "$targetDir" ] || {
-        echo "$warn (could not determine target)"
+    if [ -z "$targetDir" ] || [ -z "$pv_api" ]
+    then
+        echo "$warn (could not determine target or major.minor version)"
         echo "    PV_PLUGIN_PATH=${PV_PLUGIN_PATH:-???}"
         return 1
-    }
-
-    [ -n "$pv_api" ] || {
-        echo "$warn (could not determine major.minor version)"
-        return 1
-    }
+    fi
 
     # Include/library names
     header="pqServerManagerModel.h"