Change the cmake settings so that VTK uses the same libtcl and libtk that _tkinter links to (of course, make sure that VTK uses the tcl/tk include directories that match those same libraries!)
The output from otool shows that _tkinter links to @rpath/libtk8.6.dylib
, and it will also show what LC_RPATH
is set to, so that will give you the full path to libtk8.6.dylib and libtcl8.6.dylib.
After rebuilding, you might also have to set the LC_RPATH
in libvtkRenderingPythonTkWidgets-8.2.dylib so that it matches the LC_RPATH
used by the anaconda _tkinter. On OS X, the program install_name_tool
can be used to manipulate paths that are embedded within libraries and executables.
Do a google of “dylib rpath” for an introduction to the wonderful world of rpaths and how they can be used.