find_package(Eigen3 REQUIRED)
# Add as "system headers" to avoid warnings generated by them with
# compilers that support that notion.
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
include_directories(SYSTEM ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIRS})
if(WIN32 AND NOT BUILD_SHARED_LIBS)
  add_definitions(-DGLEW_STATIC)
endif()

find_package(Qt5 COMPONENTS Widgets REQUIRED)

find_package(VTK
  COMPONENTS
    vtkRenderingOpenGL2 vtkGUISupportQt vtkDomainsChemistry
    vtkRenderingVolumeOpenGL2 vtkViewsCore vtkRenderingFreeType
    vtkChartsCore vtkViewsContext2D vtkRenderingContextOpenGL2
  REQUIRED)
include_directories(SYSTEM ${VTK_INCLUDE_DIRS})
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${VTK_DEFINITIONS})

set(HEADERS
  vtkAvogadroActor.h
  vtkglwidget.h
  vtkplot.h
)

set(SOURCES
  vtkAvogadroActor.cxx
  vtkglwidget.cpp
  vtkplot.cpp
)

avogadro_add_library(AvogadroVtk ${HEADERS} ${SOURCES})
set_target_properties(AvogadroVtk PROPERTIES AUTOMOC TRUE)
target_link_libraries(AvogadroVtk AvogadroRendering AvogadroQtGui
  vtkRenderingOpenGL2 vtkGUISupportQt vtkRenderingVolumeOpenGL2
  vtkRenderingFreeType vtkInteractionStyle vtkChartsCore vtkViewsContext2D
  vtkRenderingContextOpenGL2 Qt5::Widgets)
