#-----------------------------------------------------------------------------
# Build Exemple Plugin
#-----------------------------------------------------------------------------
# Every PacketInterpreter found in the sources are added to the compilation (lidar, ...)
# This allow to compile private interpreter (that not appear in the public repository)
# without changing the cmakelist in the private repository
file(GLOB_RECURSE exempleInterpreter_xml ${CMAKE_CURRENT_SOURCE_DIR}/*PacketInterpreter*.xml)
file(GLOB_RECURSE exempleInterpreter_cxx ${CMAKE_CURRENT_SOURCE_DIR}/*PacketInterpreter*.cxx)
file(GLOB_RECURSE exempleInterpreter_h ${CMAKE_CURRENT_SOURCE_DIR}/*PacketInterpreter*.h)
set(exempleplugin_xml
  ${exempleInterpreter_xml}
  )
set(exempleplugin_sources
  ${exempleInterpreter_cxx}
  )
set(exempleplugin_headers
  ${exempleInterpreter_h}
  )
set(exempleplugin_classes
  ${CMAKE_CURRENT_SOURCE_DIR}/ExemplePacketInterpreter/vtkExemplePacketInterpreter
  )
set(plugin_include_dir
  ${CMAKE_CURRENT_SOURCE_DIR}/ExemplePacketInterpreter/
  )
# Create Module
vtk_module_add_module(ExempleLidar
  FORCE_STATIC # Using FORCE_STATIC build the vtk module statically into the plugin library, to avoid confusion when loading  
  SOURCES ${exempleplugin_sources} # Will not trigger a PV wrapping
  CLASSES ${exempleplugin_classes} # Those will be PV ClientServer wrapped #shorcut for sources x.cxx x.h  
  HEADERS ${exempleplugin_headers} # Those will be PV ClientServer wrapped
)
paraview_add_server_manager_xmls(
  MODULE ExempleLidar
  XMLS  ${exempleplugin_xml}
)
# WIP Following line could be removed if explicit path are used in every header file, paraview style
target_include_directories(ExempleLidar PUBLIC 
  ${plugin_include_dirs} 
  ExemplePacketInterpreter/
  ) 

