[vtkusers] RE: vtkMy TCL packages in static build

Dean Inglis dean.inglis at camris.ca
Thu Sep 23 16:22:00 EDT 2004


Goodwin,

getting closer...

I'm using the USE_VTK_OUTPUT_PATHS:BOOL=ON in my project so the libs go
to VTK_BINARY_DIR.

>Pretty much. For some reason Vtkmygraphicstcl_Init etc. is always
>capitalized (and there was a typo- the g in graphics was omitted).  You
only
>need the ${BSLASH} for the body on the #define.

fixed that and now there is ..

 ////////////////////////////////////////////

STRING(ASCII 92 BSLASH)
STRING(ASCII 34 QUOTE)

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

SET( VTK_EXTRA_TCL_LIBRARIES ${VTK_EXTRA_TCL_LIBRARIES}
     vtkLocalGraphicsTCL
     vtkLocalImagingTCL
     vtkLocalHybridTCL
     vtkLocalIoTCL
     vtkLocalRenderingTCL )

LINK_DIRECTORIES( ${VTK__BINARY_DIR} )

////////////////////////////////////////////


confirmed, LocalUserOptions.cmake is placed in the VTK source tree.


>When you run cmake for the vtk build, check in
>VTK/Wrapping/Tcl/vtkTkAppInitConfigure.h to make sure everything looks OK.
>This header gets included in vtkTkAppInit.cxx

vtkTkAppInitConfigure.h is as follows:
////////////////////////////////////////////

#ifndef __vtkTkAppInitConfigure_h
#define __vtkTkAppInitConfigure_h

#define VTK_TCL_PACKAGE_DIR_BUILD
"c:/Builder/Releases/vtkStatic/Wrapping/Tcl"
#define VTK_TCL_INSTALL_DIR "/usr/local/lib/vtk/tcl"

extern "C" int Vtklocalgraphicstcl_Init(Tcl_Interp *interp);
     extern "C" int Vtklocaliotcl_Init(Tcl_Interp *interp);
     extern "C" int Vtklocalhybridtcl_Init(Tcl_Interp *interp);
     extern "C" int Vtklocalrenderingtcl_Init(Tcl_Interp *interp);
     #define VTK_EXTRA_TCL_INIT \
     if (Vtklocalgraphicstcl_Init(interp) == TCL_ERROR) \
         { \
         return TCL_ERROR; \
         } \
     if (Vtklocaliotcl_Init(interp) == TCL_ERROR) \
         { \
         return TCL_ERROR; \
         } \
     if (Vtklocalhybridtcl_Init(interp) == TCL_ERROR) \
         { \
         return TCL_ERROR; \
         } \
     if (Vtklocalrenderingtcl_Init(interp) == TCL_ERROR) \
         { \
         return TCL_ERROR; \
         }

#endif
////////////////////////////////////////////

>See above cmake script. You can leave the instantiators out, if you like.
Why are the optional? Why do you have an instantiator for your project?


>One thing to watch out for is that the vtk build may need two passes.
Things
>are slightly cyclic.
>- Build vtk libs first... vtk.exe wont link because there's no local libs
>- Build local libs, linking in vtk libs
>- Rebuild vtk (ie link in local libs to create vtk.exe)

Yep, I get the cyclic thing: add LocalUserOptions.cmake after building
local libs etc.,and the compile seems to work,
 but I get errors in my startup scripts now saying:

can't find package vtklocalgraphics
 while executing
"package.orig require vtklocalgraphics
 ("eval" body line 1)
invoked from within
"eval package.orig $args"
(procedure "package" line...


almost there ...

Dean





More information about the vtkusers mailing list