<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Evgeniya, <br></div><div dir="ltr"><br></div><div>Based on my understanding, wrapping of custom classes without (1) creating an external VTK module or (2) using the VTK build system (like Paraview does) is not supported.</div><div><br></div><div>If possible, I suggest you re-organize your code to create a VTK external module. That you will be able to use the VTK CMake API by including the vtkExternalmoduleMacros.</div><div>For example, see <a href="https://github.com/Kitware/VTK/blob/master/Rendering/OpenVR/CMakeLists.txt">https://github.com/Kitware/VTK/blob/master/Rendering/OpenVR/CMakeLists.txt</a>  (while this module can be built both as a built-in module and an external module, it illustrates the idea)<br></div><div><br></div><div><br></div><div><br></div><div>If not possible, you need to make sure the python hierarchy files are generated. <br></div><div>Here is a module we maintain in Slicer that enable this. It provides a macro named "vtkMacroKitPythonWrap"</div><div>See <a href="https://github.com/Slicer/Slicer/blob/master/CMake/vtkMacroKitPythonWrap.cmake" target="_blank">https://github.com/Slicer/Slicer/blob/master/CMake/vtkMacroKitPythonWrap.cmake</a></div><div><br></div><div>Here is an example of usage:<br></div><div><br></div><div> include(vtkMacroKitPythonWrap)<br><br>  vtkMacroKitPythonWrap(<br>    KIT_NAME vtkFoo<br>    KIT_SRCS ${vtkFoo_SRCS}<br>  )<br></div><div><br></div><div><br></div><div>Hth</div><div>Jc<br></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 15, 2018 at 12:48 AM Evgeniya Malikova <<a href="mailto:evgenimalikova@gmail.com" target="_blank">evgenimalikova@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello.<br>
I have a common wrapping that previously worked on windows 8.1 with<br>
VTK 8.1.1.  As I had problems to compile vtk8 on Mac (don't remember<br>
all details of that) I switched to<br>
<a href="https://gitlab.kitware.com/vtk/vtk.git" rel="noreferrer" target="_blank">https://gitlab.kitware.com/vtk/vtk.git</a>.<br>
<br>
With following settings compilation on Mac of custom class gives a<br>
strange error, referencing some hierarchy file:<br>
<br>
[ 85%] Built target vtkHF<br>
<br>
make[5]: *** No rule to make target<br>
`../../hf/pythonClasses/vtkHFHierarchy', needed by<br>
`hf/pythonClasses/vtkHFFunctionPython.cxx'.  Stop.<br>
<br>
make[4]: *** [hf/pythonClasses/CMakeFiles/vtkHFPythonD.dir/all] Error 2<br>
<br>
make[3]: *** [all] Error 2<br>
<br>
make[2]: *** [hfvisual-prefix/src/hfvisual-stamp/hfvisual-build] Error 2<br>
<br>
make[1]: *** [CMakeFiles/hfvisual.dir/all] Error 2<br>
<br>
make: *** [all] Error 2<br>
<br>
//-------------<br>
<br>
My CMakeLists:<br>
<br>
<br>
find_package(VTK REQUIRED<br>
                 vtkCommonCore<br>
                 vtkCommonDataModel<br>
                 vtkCommonExecutionModel<br>
                 vtkImagingHybrid<br>
                 vtkImagingCore<br>
                 vtkImagingStencil<br>
                 vtkImagingGeneral<br>
                 vtkFiltersCore<br>
                 vtkRenderingCore<br>
                 vtkWrappingPythonCore<br>
<br>
             )<br>
 include(${VTK_USE_FILE})<br>
<br>
 # Python and vtk wrapping<br>
  find_package(PythonInterp REQUIRED)<br>
  find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT REQUIRED)<br>
  set(CUSTOM_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})<br>
 include(vtkWrapPython)<br>
 include_directories("${PYTHON_INCLUDE_PATH}")<br>
<br>
<br>
  set (OPENAL_INCLUDE_DIR ${INSTALL_DEPENDENCIES_DIR}/include/AL)<br>
<br>
  LINK_DIRECTORIES(${INSTALL_DEPENDENCIES_DIR}/lib/)<br>
set(CMAKE_MACOSX_RPATH 1)<br>
<br>
set (openAL OpenAL32)<br>
 if( APPLE )<br>
  set (openAL OpenAL)<br>
endif()<br>
<br>
  set (OPENAL_LIBRARY} ${INSTALL_DEPENDENCIES_DIR}/lib/${openAL})<br>
   set (ALUT_LIBRARY} ${INSTALL_DEPENDENCIES_DIR}/lib/alut)<br>
  include_directories(${OPENAL_INCLUDE_DIR})<br>
  include_directories(${INSTALL_DEPENDENCIES_DIR}/include)<br>
<br>
<br>
 #######################################<br>
 # Building vtkHFFunction<br>
list(APPEND libraries_list  cppinterpreter)<br>
....<br>
<br>
 add_library(vtkHF SHARED ${WRAP_LIST})<br>
<br>
 # Build main library<br>
 TARGET_LINK_LIBRARIES(vtkHF ${VTK_LIBRARIES} alut ${openAL} ${libraries_list})<br>
if(APPLE)<br>
  set_target_properties(vtkHF PROPERTIES SUFFIX ".so")<br>
endif()<br>
<br>
set(vtkHFPython_EXCLUDE_FROM_WRAP_HIERARCHY 1)<br>
# Python wrapping<br>
<br>
include_directories("${PYTHON_INCLUDE_PATH}")<br>
<br>
<br>
 #include_directories(${PythonVTKLibs_SOURCE_DIR})<br>
 #######################################<br>
 # Wrapping<br>
<br>
 vtk_wrap_python3(vtkHFPython KitPython_SRCS "${WRAP_LIST}")<br>
 add_library(vtkHFPythonD ${KitPython_SRCS} ${WRAP_LIST} )<br>
<br>
<br>
 IF(KIT_PYTHON_DEPS)<br>
  ADD_DEPENDENCIES(vtkHFPythonD ${KIT_PYTHON_DEPS} ${VTK_PYTHON_LIBRARIES})<br>
ENDIF(KIT_PYTHON_DEPS)<br>
<br>
#Here happens error<br>
 python_add_module(vtkHFPython vtkHFPythonInit.cxx)<br>
<br>
<br>
What I do wrong?<br>
Thank you in advance,<br>
Best regards, Evgeniya<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div>