<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">I already tried this without any
      success. I have no idea what is wrong with it. You can try to
      modify my code to find out the correct necessary changes.<br>
      <br>
      Best regards<br>
      Ronald<br>
      <br>
      <br>
      On 10.10.2017 04:59, David Gobbi wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CANwS1=HDjzqOSKy5+ysBPsUiph3n8wtU190c+DVXfQP9SZd8GA@mail.gmail.com">
      <div dir="ltr">
        <div>Hi Ronald,</div>
        <div><br>
        </div>
        <div>Use the following:</div>
        <div><br>
        </div>
        <div>target_link_libraries(${PROJECT_NAME}PythonD
          ${PROJECT_NAME} vtkWrappingPythonCore)</div>
        <div><br>
        </div>
        <div>You might also have to add vtkWrappingPythonCore to the
          components for find_package(VTK).</div>
        <div><br>
        </div>
        <div> - David</div>
        <div><br>
        </div>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Mon, Oct 9, 2017 at 8:34 PM,
            Ronald Römer <span dir="ltr"><<a
                href="mailto:rroemer@gmail.com" target="_blank"
                moz-do-not-send="true">rroemer@gmail.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">
              <div dir="ltr">
                <div dir="ltr">
                  <div>
                    <div>
                      <div>
                        <div>
                          <div>
                            <div>Hello,<br>
                              <br>
                            </div>
                            I'm trying to fix a problem with the python
                            wrapper of my library. In my CMakeLists.txt
                            there are the following lines:<br>
                          </div>
                          <div><br>
                          </div>
                          <div>find_package(VTK REQUIRED COMPONENTS
                            vtkFiltersSources vtkIOLegacy
                            vtkFiltersExtraction vtkFiltersGeometry
                            vtkFiltersModeling vtkRenderingFreeType
                            NO_MODULE)<br>
                            <br>
                            include(${VTK_USE_FILE})<br>
                          </div>
                          <div><br>
                            if(VTK_WRAP_PYTHON)<br>
                                find_package(PythonLibs 2.7 REQUIRED)<br>
                            <br>
                                if(PYTHONLIBS_FOUND)<br>
                            <br>
                                    include_directories(${PYTHON_<wbr>INCLUDE_DIRS}
                            ${PROJECT_SOURCE_DIR})<br>
                            <br>
                                    include(vtkWrapPython)<br>
                            <br>
                                    vtk_wrap_python3(${PROJECT_<wbr>NAME}Python
                            ${PROJECT_NAME}Python_srcs
                            vtkPolyDataBooleanFilter.cxx)<br>
                            <br>
                                    add_library(${PROJECT_NAME}<wbr>PythonD
                            ${${PROJECT_NAME}Python_srcs})<br>
                                    target_link_libraries(${<wbr>PROJECT_NAME}PythonD
                            ${PROJECT_NAME})<br>
                            <br>
                                    add_library(${PROJECT_NAME}<wbr>Python
                            MODULE ${PROJECT_NAME}PythonInit.cxx)<br>
                                    target_link_libraries(${<wbr>PROJECT_NAME}Python
                            ${PROJECT_NAME}PythonD)<br>
                            <br>
                                endif()<br>
                            endif()<br>
                            <br>
                          </div>
                          When I try to import the module into a python
                          script, I get an import error about undefined
                          symbols like PyVTKObject_Type. After a little
                          research with nm I found out that the shared
                          object is not linked to
                          libvtkWrappingPython27Core. Here are the first
                          lines of it:<br>
                          <br>
                        </div>
                        U PyBool_FromLong<br>
                        U PyDict_SetItemString<br>
                        U PyErr_Occurred<br>
                        U PyInt_FromLong<br>
                        U PyModule_GetDict<br>
                        U PyString_FromString<br>
                        0000000000003020 T PyVTKAddFile_<wbr>vtkPolyDataBooleanFilter<br>
                        U PyVTKClass_New<br>
                        U PyVTKClass_Type<br>
                        U PyVTKClass_<wbr>vtkPolyDataAlgorithmNew<br>
                        <br>
                      </div>
                      How to fix this? There is no documentation about
                      the the python wrapper, except <a
                        href="https://www.vtk.org/Wiki/VTK/Python_Wrapping_FAQ"
                        target="_blank" moz-do-not-send="true">https://www.vtk.org/Wiki/VTK/<wbr>Python_Wrapping_FAQ</a>.<br>
                      <br>
                    </div>
                    I'm actually using VTK 6.3 and my library can be
                    found on <a
                      href="https://github.com/zippy84/vtkbool"
                      target="_blank" moz-do-not-send="true">https://github.com/zippy84/<wbr>vtkbool</a>.<br>
                    <br>
                  </div>
                  Best regards</div>
                <span class="gmail-HOEnZb"><font color="#888888">
                    <div>Ronald<br>
                    </div>
                  </font></span></div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>