Before VTK 9, I was still able to compile this rather old lib found in the VTK journal.
My knowledge of C++ and CMake being more or less void, is there an easy fix to this CMakeList to make it VTK 9-compilable?
project( vtkMeshGeodesics )
find_package( VTK REQUIRED )
include( ${VTK_USE_FILE} )
set( vtkMeshGeodesics_SRCS
vtkPolyDataGeodesicDistance.cxx
vtkFastMarchingGeodesicDistance.cxx
vtkFastMarchingGeodesicPath.cxx
vtkPolygonalSurfaceContourLineInterpolator2.cxx )
set( vtkMeshGeodesics_HDRS
vtkPolyDataGeodesicDistance.h
vtkFastMarchingGeodesicDistance.h
vtkFastMarchingGeodesicPath.h
vtkPolygonalSurfaceContourLineInterpolator2.h )
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../FastMarching
${CMAKE_CURRENT_SOURCE_DIR}/../FastMarching/gw_core
${CMAKE_CURRENT_SOURCE_DIR}/../FastMarching/gw_geodesic
)
add_library( vtkMeshGeodesics
${vtkMeshGeodesics_SRCS}
${vtkMeshGeodesics_HDRS} )
target_link_libraries( vtkMeshGeodesics MeshGeodesics )
Removing the VTK_USE_FILE
line removes the CMake warning but compilation terminates with: fatal error: vtkPolyDataAlgorithm.h: file not found
I tried appending
vtk_module_autoinit(
TARGETS vtkMeshGeodesics
MODULES
VTK::WrappingTools
[...]
)
“[…]” being replaced by the list of all VTK modules I could find with a very subtle: grep "Create imported target VTK::" VTK-9.0.1/build/lib/cmake/vtk-9.0/VTK-targets.cmake | cut -c25-
but it did not help.
So… is this easily fixable?