[vtkusers] Re: vtkMy TCL packages in static build

Goodwin Lawlor goodwin.lawlor at ucd.ie
Thu Sep 23 05:37:29 EDT 2004


Hi Dean,

With a shared local build you can alway load your package into vtk.exe with
"load" but with static local libraries, these have to be linked into vtk.exe
when its being built.

In CVS version of vtk (after the end of July 04), there's now an option to
link a local project, when building vtk.exe... read the comments at the top
of \Wrapping\Tcl\CMakeLists.txt. This option should be added into
\Wrapping\Tcl\LocalUserOptions.cmake file. I found I needed to define some
strings to get it to work... here's what my
\Wrapping\Tcl\LocalUserOptions.cmake  looks like (my project is called
bioeng):

# Start of LocalUserOptions.cmake
STRING(ASCII 92 BSLASH)
STRING(ASCII 34 QUOTE)

SET( VTK_EXTRA_TCL_WRAPPING_CODE   "extern ${QUOTE}C${QUOTE} int
Vtkbioengtcl_Init(Tcl_Interp *interp);
#define VTK_EXTRA_TCL_INIT ${BSLASH}
if (Vtkbioengtcl_Init(interp) == TCL_ERROR) ${BSLASH}
  { ${BSLASH}
  return TCL_ERROR; ${BSLASH}
  }")

SET(VTK_EXTRA_TCL_LIBRARIES ${VTK_EXTRA_TCL_LIBRARIES} vtkBioengTCL)
# End of LocalUserOptions.cmake

You may also like to include here
#include "vtkBioengInstantiator.h"
INCLUDE_DIRECTORIES(...)



I also needed to change vtkTkAppInit.cxx slightly, moving "#include
"Wrapping/Tcl/vtkTkAppInitConfigure.h"" to below "#include "vtkTk.h"".
Here's a patch:

RCS file: /cvsroot/VTK/VTK/Wrapping/Tcl/vtkTkAppInit.cxx,v
retrieving revision 1.21
diff -u -r1.21 vtkTkAppInit.cxx
--- Wrapping/Tcl/vtkTkAppInit.cxx 28 Jul 2004 20:17:03 -0000 1.21
+++ Wrapping/Tcl/vtkTkAppInit.cxx 9 Aug 2004 20:20:40 -0000
@@ -33,7 +33,7 @@
 #include "vtkConfigure.h"
 #include "vtkSystemIncludes.h"
 #include "vtkToolkits.h"
-#include "Wrapping/Tcl/vtkTkAppInitConfigure.h"
+

 #ifdef VTK_TCL_TK_COPY_SUPPORT_LIBRARY
 #include <sys/stat.h>
@@ -51,6 +51,8 @@
 # include "vtkTcl.h"
 #endif

+#include "Wrapping/Tcl/vtkTkAppInitConfigure.h"
+
 /*
  * Make sure all the kits register their classes with vtkInstantiator.
  */

Maybe a page in the Wiki would be good for this...


hth

Goodwin

<dean.inglis at camris.ca> wrote in message
news:20040923001438.XND3656.tomts7-srv.bellnexxia.net at mxmta.bellnexxia.net...
> Hi,
>  I've built a local source directory, in flavor of
> VTK/Examples/Build/vtkMy
> which has a lot of my own vtk classes and compiled
> them in static (as opposed to shared dll's) lib mode.
> The libs are built and stored in my out of source VTK build dir
> (e.g., vtkStatic/bin )
>
> I have read and followed the path setting instructions in
> VTK/Examples/Build/vtkMy/README
> but can't get the tcl examples I have written to
> work as I could when I compiled under shared mode.
> I am using vtk.exe to open and run the VTK tcl tests/examples
> successfully but not my own.  I confess I am not a
> tcl wrapping expert, but it was relatively painless before.
>
> any ideas out there?
>
> Dean
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>






More information about the vtkusers mailing list