# Label our AutoStart class as an AutoStart class for ParaView, with the startup
# method "startup()" and the shutdown method "shutdown()"
set(PLUGIN_AUTOSTART_IFACES)
set(PLUGIN_AUTOSTART_IFACE_SRCS)

set(PQPluginHdrs
  pqSMTKResourceManagerStateAutoStart.h
  pqSMTKReadResourceManagerStateBehavior.h
  pqSMTKWriteResourceManagerStateBehavior.h
  )

set(PQPluginSrcs
  pqSMTKResourceManagerStateAutoStart.cxx
  pqSMTKReadResourceManagerStateBehavior.cxx
  pqSMTKWriteResourceManagerStateBehavior.cxx
  )

add_paraview_auto_start(PLUGIN_AUTOSTART_IFACES PLUGIN_AUTOSTART_IFACE_SRCS
  CLASS_NAME pqSMTKResourceManagerStateAutoStart
  STARTUP startup
  SHUTDOWN shutdown
  )

# Construct the MOC files associated with our AutoStart class
pv_qt_wrap_cpp(PLUGIN_MOC_SRCS ${PQPluginHdrs})

include(SMTKPluginMacros)

add_smtk_plugin(
  smtkReadWriteResourceManagerStatePlugin "1.0"
  GUI_INTERFACES
  ${PLUGIN_AUTOSTART_IFACES}
  GUI_SOURCES
  ${PQPluginHdrs}
  ${PQPluginSrcs}
  ${PLUGIN_MOC_SRCS}
  ${PLUGIN_AUTOSTART_IFACE_SRCS}
  REQUIRED_PLUGINS
  smtkPQComponentsPlugin
  REGISTRAR smtk::resource_manager_state::Registrar
  REGISTRAR_HEADER operators/Registrar.h
  MANAGERS smtk::operation::Manager
  )

smtk_export_header(smtkReadWriteResourceManagerStatePlugin Exports.h)

target_link_libraries(smtkReadWriteResourceManagerStatePlugin
  LINK_PUBLIC
  smtkCore
  smtkPQComponentsExt
  smtkReadWriteResourceManagerState
  pqApplicationComponents
  pqComponents
  ${Boost_LIBRARIES}
  Qt5::Core
  )

# Install the library and exports
install(
  TARGETS smtkReadWriteResourceManagerStatePlugin
  EXPORT  ReadWriteSMTKResourceManagerState
  ARCHIVE DESTINATION lib
  LIBRARY DESTINATION lib
  RUNTIME DESTINATION bin)

install(
  EXPORT      ReadWriteSMTKResourceManagerState
  DESTINATION lib/cmake/ReadWriteSMTKResourceManagerState
  FILE        ReadWriteSMTKResourceManagerState-targets.cmake)
