[vtkusers] CMake custom class python wrapping doesn't work

Evgeniya Malikova evgenimalikova at gmail.com
Mon Oct 15 00:47:45 EDT 2018


Hello.
I have a common wrapping that previously worked on windows 8.1 with
VTK 8.1.1.  As I had problems to compile vtk8 on Mac (don't remember
all details of that) I switched to
https://gitlab.kitware.com/vtk/vtk.git.

With following settings compilation on Mac of custom class gives a
strange error, referencing some hierarchy file:

[ 85%] Built target vtkHF

make[5]: *** No rule to make target
`../../hf/pythonClasses/vtkHFHierarchy', needed by
`hf/pythonClasses/vtkHFFunctionPython.cxx'.  Stop.

make[4]: *** [hf/pythonClasses/CMakeFiles/vtkHFPythonD.dir/all] Error 2

make[3]: *** [all] Error 2

make[2]: *** [hfvisual-prefix/src/hfvisual-stamp/hfvisual-build] Error 2

make[1]: *** [CMakeFiles/hfvisual.dir/all] Error 2

make: *** [all] Error 2

//-------------

My CMakeLists:


find_package(VTK REQUIRED
                 vtkCommonCore
                 vtkCommonDataModel
                 vtkCommonExecutionModel
                 vtkImagingHybrid
                 vtkImagingCore
                 vtkImagingStencil
                 vtkImagingGeneral
                 vtkFiltersCore
                 vtkRenderingCore
                 vtkWrappingPythonCore

             )
 include(${VTK_USE_FILE})

 # Python and vtk wrapping
  find_package(PythonInterp REQUIRED)
  find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT REQUIRED)
  set(CUSTOM_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
 include(vtkWrapPython)
 include_directories("${PYTHON_INCLUDE_PATH}")


  set (OPENAL_INCLUDE_DIR ${INSTALL_DEPENDENCIES_DIR}/include/AL)

  LINK_DIRECTORIES(${INSTALL_DEPENDENCIES_DIR}/lib/)
set(CMAKE_MACOSX_RPATH 1)

set (openAL OpenAL32)
 if( APPLE )
  set (openAL OpenAL)
endif()

  set (OPENAL_LIBRARY} ${INSTALL_DEPENDENCIES_DIR}/lib/${openAL})
   set (ALUT_LIBRARY} ${INSTALL_DEPENDENCIES_DIR}/lib/alut)
  include_directories(${OPENAL_INCLUDE_DIR})
  include_directories(${INSTALL_DEPENDENCIES_DIR}/include)


 #######################################
 # Building vtkHFFunction
list(APPEND libraries_list  cppinterpreter)
....

 add_library(vtkHF SHARED ${WRAP_LIST})

 # Build main library
 TARGET_LINK_LIBRARIES(vtkHF ${VTK_LIBRARIES} alut ${openAL} ${libraries_list})
if(APPLE)
  set_target_properties(vtkHF PROPERTIES SUFFIX ".so")
endif()

set(vtkHFPython_EXCLUDE_FROM_WRAP_HIERARCHY 1)
# Python wrapping

include_directories("${PYTHON_INCLUDE_PATH}")


 #include_directories(${PythonVTKLibs_SOURCE_DIR})
 #######################################
 # Wrapping

 vtk_wrap_python3(vtkHFPython KitPython_SRCS "${WRAP_LIST}")
 add_library(vtkHFPythonD ${KitPython_SRCS} ${WRAP_LIST} )


 IF(KIT_PYTHON_DEPS)
  ADD_DEPENDENCIES(vtkHFPythonD ${KIT_PYTHON_DEPS} ${VTK_PYTHON_LIBRARIES})
ENDIF(KIT_PYTHON_DEPS)

#Here happens error
 python_add_module(vtkHFPython vtkHFPythonInit.cxx)


What I do wrong?
Thank you in advance,
Best regards, Evgeniya


More information about the vtkusers mailing list