# Insert VTK_DATA_ROOT given to cmake into vtkGetDataRoot.m
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/vtkGetDataRoot.m
  ${CMAKE_CURRENT_BINARY_DIR}/vtkGetDataRoot.m)

# Replace vtkGetDataRoot.m from the source directory by the configured file
# from the binary directory
FILE(GLOB M_SCRIPTS "*.m")
LIST(REMOVE_ITEM M_SCRIPTS vtkGetDataRoot.m)
LIST(APPEND M_SCRIPTS ${CMAKE_CURRENT_BINARY_DIR}/vtkGetDataRoot.m)
INSTALL(FILES ${M_SCRIPTS} DESTINATION ${OCTAVIZ_M_DIR})
