[vtkusers] vtkMy TCL packages in static build

Dean Inglis dean.inglis at camris.ca
Thu Sep 23 13:49:37 EDT 2004


Hi Goodwin,

>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):

thanks for the sample.  It seems that your project is modelled after
VTK/Examples//Build/vtkLocal which contains all the user defined
classes in that root directory and not with multiple sub-dirs as
in VTK/Examples/Build/vtkMy

So, for me,

>SET(VTK_EXTRA_TCL_LIBRARIES ${VTK_EXTRA_TCL_LIBRARIES} vtkBioengTCL)

would have to be, for example:

SET( VTK_EXTRA_TCL_LIBRARIES ${VTK_EXTRA_TCL_LIBRARIES}
     vtkMyGraphicsTCL
     vtkMyImagingTCL
     vtkMyHybridTCL
     vtkMyIoTCL
     vtkMyRenderingTCL )

but I do not know what to do about the extern C scripting that precedes.

Does this seem sensible:
////////////////////////////////////////////
# Start of LocalUserOptions.cmake

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

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

SET( VTK_EXTRA_TCL_LIBRARIES ${VTK_EXTRA_TCL_LIBRARIES}
     vtkMyGraphicsTCL
     vtkMyImagingTCL
     vtkMyHybridTCL
     vtkMyIoTCL
     vtkMyRenderingTCL )

# End of LocalUserOptions.cmake
/////////////////////////////////////


Also, do I create a LocalUserOptions.cmake and place it in my VTK source
tree:
VTK/Utilities/Wrapping/Tcl/LocalUserOptions.cmake ?

I'm not sure what you mean here...

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

many thanks so far...

Dean







More information about the vtkusers mailing list