set(headers)
set(interfaces
  AEVAContextMenu
  ApplicationConfiguration
  pqAEVAShortcuts
)
set(sources)

set(classes
  AEVAContextMenu
  ApplicationConfiguration
  pqAEVAShortcuts
  pqAEVASurfaceFeatureToolBar
  pqSMTKProportionalEditItemWidget
  pqProportionalEditPropertyWidget
  pqSMTKVolumeInspectionItemWidget
  pqVolumeInspectionPropertyWidget
  pqAEVAWidgetsAutoStart
)

foreach(class ${classes})
  list(APPEND sources ${class}.cxx)
  list(APPEND headers ${class}.h)
endforeach()

set(ui_files
  resources/pqProportionalEditPropertyWidget.ui
  resources/pqVolumeInspectionPropertyWidget.ui
)
set(CMAKE_AUTOUIC_SEARCH_PATHS
  "${CMAKE_CURRENT_SOURCE_DIR}/resources")

set_property(SOURCE smtkAEVASessionPlugin_qch.h PROPERTY SKIP_AUTOGEN ON)

paraview_plugin_add_toolbar(
  CLASS_NAME pqAEVASurfaceFeatureToolBar
  INTERFACES action_group_interfaces
  SOURCES action_group_sources
)

list(APPEND interfaces ${action_group_interfaces})
list(APPEND sources ${action_group_sources})

smtk_encode_file( "${CMAKE_CURRENT_SOURCE_DIR}/uberon.owl" TYPE "_cpp" HEADER_OUTPUT owlXMLHeader)
list(APPEND sources "${owlXMLHeader}")

# Put the contents of this file in a *function* in a header, ending in `_cpp.h`.
smtk_encode_file("${CMAKE_CURRENT_SOURCE_DIR}/DiagramConfiguration.json"
  NAME "diagramPanelConfiguration"
  TYPE "_cpp"
  HEADER_OUTPUT dpXmlHeader
)
list(APPEND sources "${dpXmlHeader}")

paraview_plugin_add_auto_start(
  CLASS_NAME pqAEVAWidgetsAutoStart
  INTERFACES auto_start_interfaces
  SOURCES auto_start_sources)
list(APPEND interfaces
  ${auto_start_interfaces})
list(APPEND sources
  ${auto_start_sources})

smtk_add_plugin(
  smtkAEVASessionPlugin
  REGISTRARS
    smtk::session::aeva::Registrar
  MANAGERS
    smtk::common::Managers
    smtk::operation::Manager
    smtk::resource::Manager
    smtk::view::Manager
  PARAVIEW_PLUGIN_ARGS
    VERSION "1.0"
    REQUIRED_ON_SERVER
    REQUIRED_ON_CLIENT
    SERVER_MANAGER_XML smconfig.xml
    UI_INTERFACES ${interfaces}
    UI_FILES ${ui_files}
    SOURCES ${sources}
    MODULES VTK::AEVAExt
)
target_link_libraries(smtkAEVASessionPlugin
  LINK_PUBLIC
    smtkAEVASession
  LINK_PRIVATE
    ParaView::pqApplicationComponents
    ParaView::pqCore
    smtkPQComponentsExt
    smtkPQWidgetsExt
    VTK::FiltersCore
    VTK::FiltersGeometry
)
if (WIN32)
  # Disable sccache/distcc on this target; it seems to fail due to the large
  # generated uberon_cpp.h header.
  set_property(TARGET smtkAEVASessionPlugin PROPERTY CXX_COMPILER_LAUNCHER "")
endif()
target_compile_definitions(smtkAEVASessionPlugin
  PRIVATE
    QT_NO_KEYWORDS)
