Hi Inna,
You are correct that there is a problem parsing the header, it is triggered by this code:
","<<axes_x.GetY();
This is very strange, because it works fine if spaces are added:
"," << axes_x.GetY();
It’s a little mystery that I can investigate.
For wrapping with VTK 8.2, see the cmake code below. Note that I removed “MODULE” from the first add_library(). The only thing that should be built as a module is the python module, vtkGeodesicPython.so (or .pyd on Windows).
The PROPERTY POSITION_INDEPENDENT_CODE ON
is needed in case you are doing a static build on a 64-bit linux (or mac) system and linking the static libraries to the python module (it enables the ‘-fPIC’ option of the compiler).
#######################################
# Building vtkGeodesic
add_library(${LIB_NAME} vtkGeodesic.cpp)
target_link_libraries(${LIB_NAME} ${VTK_LIBRARIES})
#######################################
# Wrapping vtkGeodesic
set(MODULE_HIERARCHY_NAME ${LIB_NAME}Hierarchy)
# All libs mentioned here must be listed in the find_package(VTK ...)
set(${LIB_NAME}_LINK_DEPENDS vtkCommonCore vtkCommonDataModel)
set(${LIB_NAME}_WRAP_DEPENDS vtkCommonCore vtkCommonDataModel)
set(OTHER_HIERARCHY_FILES)
foreach(dep ${${LIB_NAME}_LINK_DEPENDS})
list(APPEND OTHER_HIERARCHY_FILES "${${dep}_WRAP_HIERARCHY_FILE}")
endforeach()
include(vtkWrapHierarchy)
vtk_wrap_hierarchy(${LIB_NAME} ${CMAKE_CURRENT_BINARY_DIR} "${LIB_SRCS}")
set(KIT_HIERARCHY_FILE ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_HIERARCHY_NAME}.txt)
set(LIB_HIERARCHY_STAMP ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_HIERARCHY_NAME}.stamp.txt)
vtk_wrap_python3(${LIB_NAME}Python ${LIB_NAME}Python_SRCS vtkGeodesic.cpp)
MESSAGE("vtkGeodesicPython_SRCS = ${vtkGeodesicPython_SRCS}")
add_library(${LIB_NAME}PythonD ${${LIB_NAME}Python_SRCS} vtkGeodesic.cpp)
set_property(TARGET ${LIB_NAME}PythonD
PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_libraries(${LIB_NAME}PythonD
${VTK_LIBRARIES}
vtkWrappingPythonCore
${VTK_PYTHON_LIBRARIES})
add_library(${LIB_NAME}Python MODULE ${LIB_NAME}PythonInit.cxx)
set(VTK_MODULES_USED vtkCommonDataModel vtkCommonCore)
set(VTK_PYTHOND_LIBS)
foreach(TMP_LIB ${VTK_MODULES_USED})
set(VTK_PYTHOND_LIBS ${VTK_PYTHOND_LIBS} ${TMP_LIB}PythonD)
endforeach()
target_link_libraries(${LIB_NAME}Python ${LIB_NAME}PythonD ${VTK_PYTHOND_LIBS})
set_target_properties(${LIB_NAME}Python PROPERTIES PREFIX "")
if(WIN32 AND NOT CYGWIN)
set_target_properties(${LIB_NAME}Python PROPERTIES SUFFIX ".pyd")
endif(WIN32 AND NOT CYGWIN)