vtk.cmake 1.48 KB
Newer Older
Burlen Loring's avatar
Burlen Loring committed
1
set(SENSEI_VTK_COMPONENTS vtkCommonDataModel)
2 3 4 5
if (ENABLE_VTK_MPI)
  list(APPEND SENSEI_VTK_COMPONENTS vtkParallelMPI)
endif()
if (ENABLE_VTK_IO)
Burlen Loring's avatar
Burlen Loring committed
6
  list(APPEND SENSEI_VTK_COMPONENTS vtkIOXML)
7 8 9
  if (ENABLE_VTK_MPI)
    list(APPEND SENSEI_VTK_COMPONENTS vtkIOParallelXML)
  endif()
Burlen Loring's avatar
Burlen Loring committed
10
endif()
11 12 13 14 15 16 17 18 19
if (ENABLE_VTK_RENDERING)
  list(APPEND SENSEI_VTK_COMPONENTS vtkRenderingCore)
  if (TARGET vtkRenderingOpenGL2)
    list(APPEND SENSEI_VTK_COMPONENTS vtkRenderingOpenGL2)
  endif()
  if (TARGET vtkRenderingOpenGL)
    list(APPEND SENSEI_VTK_COMPONENTS vtkRenderingOpenGL)
  endif()
endif()
Burlen Loring's avatar
Burlen Loring committed
20 21 22
if (ENABLE_PYTHON)
  list(APPEND SENSEI_VTK_COMPONENTS vtkPython vtkWrappingPythonCore)
endif()
23
if (ENABLE_VTK_ACCELERATORS)
24 25
  list(APPEND SENSEI_VTK_COMPONENTS vtkAcceleratorsVTKm vtkIOLegacy
    vtkFiltersGeometry vtkImagingCore)
26
endif()
Burlen Loring's avatar
Burlen Loring committed
27 28

if (NOT ENABLE_CATALYST)
Burlen Loring's avatar
Burlen Loring committed
29
  add_library(svtk INTERFACE)
Burlen Loring's avatar
Burlen Loring committed
30 31 32 33 34 35 36 37

  find_package(VTK QUIET COMPONENTS ${SENSEI_VTK_COMPONENTS})
  if (NOT VTK_FOUND)
    message(FATAL_ERROR "VTK (${SENSEI_VTK_COMPONENTS}) modules are required for "
      "Sensei core even when not using any infrastructures. Please set "
      "VTK_DIR to point to a directory containing `VTKConfig.cmake`.")
  endif()

Burlen Loring's avatar
Burlen Loring committed
38 39 40
  target_link_libraries(svtk INTERFACE ${VTK_LIBRARIES})
  target_include_directories(svtk SYSTEM INTERFACE ${VTK_INCLUDE_DIRS})
  target_compile_definitions(svtk INTERFACE ${VTK_DEFINITIONS})
Burlen Loring's avatar
Burlen Loring committed
41

Burlen Loring's avatar
Burlen Loring committed
42 43
  install(TARGETS svtk EXPORT svtk)
  install(EXPORT svtk DESTINATION lib/cmake EXPORT_LINK_INTERFACE_LIBRARIES)
Burlen Loring's avatar
Burlen Loring committed
44
endif()