Trouble Building External Plugins with Superbuild

When I configure a build using the paraview-superbuild (v5.8.0), I don’t see any external plugins built, despite configuring them as follows:

cmake -make \
	-DENABLE_paraviewpluginsexternal=ON \
	-Dparaview_PLUGINS_AUTOLOAD=PhastaSyncIOReader \
	-Dparaview_PLUGINS_EXTERNAL=PhastaSyncIOReader \
	-Dparaview_PLUGIN_PhastaSyncIOReader_PATH=/home/npillai2/ParaViewSyncIOReaderPlugin \
	-DSUPERBUILD_PROJECT_PARALLELISM=2 \
	-DCMAKE_INSTALL_PREFIX=/usr/local/usrapps/iabolotn/install/paraview_5.8.0 \
      ../paraview-superbuild 

when adding the following [as suggested here]

IF (ParaView_SOURCE_DIR)
  INCLUDE_DIRECTORIES( ${VTK_INCLUDE_DIRS} )
ELSE (ParaView_SOURCE_DIR)
  FIND_PACKAGE(ParaView REQUIRED)
  INCLUDE(${PARAVIEW_USE_FILE})
ENDIF (ParaView_SOURCE_DIR)

to the end of my CMakeLists.txt (lines 375-380) [which, by the way, is not located in the “build” directory, only the parent “paraview-superbuild”] , I get this error if I go through ccmake

CMake Error at CMakeLists.txt:378 (FIND_PACKAGE):
   By not providing "FindParaView.cmake" in CMAKE_MODULE_PATH this project has
   asked CMake to find a package configuration file provided by "ParaView",
   but CMake did not find one.

   Could not find a package configuration file provided by "ParaView" with any
   of the following names:

     ParaViewConfig.cmake
     paraview-config.cmake

   Add the installation prefix of "ParaView" to CMAKE_PREFIX_PATH or set
   "ParaView_DIR" to a directory containing one of the above files.  If
   "ParaView" provides a separate development package or SDK, be sure it has
   been installed.

This is a little confusing to me as usually the parent directory with whatever I get from github has those files (i.e. if it’s not the superbuild, e.g. via “git clone https://gitlab.kitware.com/paraview/paraview.git”) but the superbuild works so many layers of magic, I have no idea where those files are.

Am I putting the commands in the right place? And if not, how should I go about resolving this issue?

Update on this issue - I did locate the paraview-config.cmake file (after building) at build/superbuild/paraview/build/lib/cmake/paraview-5.8/

I tried another approach to just build the plugin by itself pointing to the above path for ParaView_DIR

and ran into this error

CMake Error at CMakeLists.txt:22 (ADD_PARAVIEW_PLUGIN):
  Unknown CMake command "ADD_PARAVIEW_PLUGIN".

The whole CMakeLists.txt looks like this

cmake_minimum_required(VERSION 2.8)

if(NOT ParaView_SOURCE_DIR)
  find_package(ParaView REQUIRED)
  include(${PARAVIEW_USE_FILE})
  include_directories(${CMAKE_CURRENT_SOURCE_DIR})
else()
  include_directories(
    ${PARAVIEW_INCLUDE_DIRS}
    ${PARAVIEW_KWSYS_INCLUDE_DIRS}
    ${VTK_INCLUDE_DIRS}
  )
endif()

ADD_PARAVIEW_PLUGIN(PhastaSyncIOReader "1.0"
                                       SERVER_MANAGER_XML PhastaSyncIO.xml
                                       SERVER_MANAGER_SOURCES
                                       vtkPhastaSyncIOMetaReader.cxx
                                       vtkPhastaSyncIOReader.cxx
                                       REQUIRED_ON_SERVER
                                       )

and the plugin.cmake looks like this

if (PARAVIEW_USE_MPI)
  pv_plugin(PhastaSyncIOReader
    DESCRIPTION "Phasta SyncIO Reader"
    # uncomment AUTOLOAD to have the plugin automatically loaded. Note
    # though that this isn't working in PV 5.2 and probably earlier
    AUTOLOAD
    DEFAULT_ENABLED)
endif()

Since the last known version the plugin was built for was 5.2.0, I’m not sure if anything in there is out of date, or how to fix it - does anyone have any thoughts?

These docs should help you in migrating to the new plugin CMake API.