[vtkusers] CMake and Add a Local directory of new classes?

Tuhin Sinha tk.sinha at vanderbilt.edu
Fri Jan 17 09:43:47 EST 2003


Jean,

  I don't know if you've looked at ${VTKSRC}/Examples/Build/vtkMy, but I think 
that's what you want.  There is a README in there to walk you through it, but 
for the most part I just dump my new classes in vtkMy/Unsorted, add the name 
of the source file to the CMakeList.txt in Unsorted and I'm done.  Whoever, 
set this up is a god-send, my hats off.  Furthermore, it might be worthwhile 
to point new users to this directory instead of the directions on how to set 
up a 'local' directory.

HTH,

Tuhin

On Friday 17 January 2003 08:09, Jean M. Favre wrote:
> Hello
>
> I am having trouble adding a set of new classes in a Local directory
> with Tcl Wrapping.
>
> I have followed the directions in README.html#NewClass but it does not
> seem to be enough to make Cmake generate all the required stuff:
>
> I use VTK nightly and CMake 1.4.6
> Here is what I ended up trying. It compiled but my classes are not
> visible when I run bin/vtk? Any suggestions:
>
> 1) Edit Wrapping/Tcl/pkgIndex.tcl.in
>         add Local to Wrapping/Tcl/pkgIndex.tcl.in
>         foreach kit {...  Local}
>
>         Add a line to check class?
>         set classTable(vtkLocalTCL) vtkLocalClass # name of one your
> Local classes
>
> 2) Create Wrapping/Tcl/LocalUserOptions.cmake
>         TARGET_LINK_LIBRARIES(vtk vtkLocalTCL)
>         SUBDIRS(vtk vtklocal)
>
> 3) Create in directory Wrapping/Tcl/vtklocal
>         Edit CMakeLists.txt with:
>         INSTALL_FILES(/lib/vtk/tcl/vtklocal .tcl vtklocal)
>
>         Edit vtklocal.tcl with:
>
> if {[info commands ::vtk::init::require_package] != ""} {
>   if {[::vtk::init::require_package vtkLocalTCL 4.1]} {
>     package provide vtklocal 4.1
>   }
> }
>         Edit  pkgIndex.tcl with:
>
> package ifneeded vtklocal 4.1 [list source [file join $dir
> vtklocal.tcl]]
>
> 4) Create file VTK/LocalUserOptions.cmake with:
> SUBDIRS(Local)
>
> 5) Create in directory VTK/Local
>         create file CMakeLists.txt
> SET( Local_SRCS
> list of local vtk class .cxx names
> )
>
> # Setup vtkInstantiator registration for this library's classes.
> #IF (COMMAND VTK_MAKE_INSTANTIATOR2)
> #  VTK_MAKE_INSTANTIATOR2(vtkLocalInstantiator LocalInstantiator_SRCS
> #                      ${Local_SRCS}
> #                      EXPORT_MACRO VTK_LOCAL_EXPORT
> #                      HEADER_LOCATION ${VTK_BINARY_DIR})
> #
> #ELSE (COMMAND VTK_MAKE_INSTANTIATOR2)
> #  VTK_MAKE_INSTANTIATOR(vtkLocalInstantiator LocalInstantiator_SRCS
> #                      ${Local_SRCS}
> #                      EXPORT_MACRO VTK_LOCAL_EXPORT
> #                      HEADER_LOCATION ${VTK_BINARY_DIR})
> #ENDIF (COMMAND VTK_MAKE_INSTANTIATOR2)
>
> #ADD_LIBRARY(vtkLocal ${Local_SRCS} ${LocalInstantiator_SRCS})
> ADD_LIBRARY(vtkLocal ${Local_SRCS})
>
> # Allow the user to customize their build with some local options
> #
> INCLUDE (${VTK_BINARY_DIR}/Local/LocalUserOptions.cmake OPTIONAL)
> INCLUDE (${VTK_SOURCE_DIR}/Local/LocalUserOptions.cmake OPTIONAL)
>
> TARGET_LINK_LIBRARIES (vtkLocal)
>
> IF (VTK_WRAP_TCL)
>   VTK_WRAP_TCL(vtkLocalTCL LocalTCL_SRCS ${Local_SRCS})
>   ADD_LIBRARY(vtkLocalTCL ${LocalTCL_SRCS})
>   TARGET_LINK_LIBRARIES (vtkLocalTCL
>                          vtkLocal
>                          ${TCL_LIBRARY})
>   INSTALL_TARGETS(/lib/vtk vtkLocalTCL)
> ENDIF (VTK_WRAP_TCL)
>
> INSTALL_TARGETS(/lib/vtk vtkLocal)
> INSTALL_FILES(/include/vtk .h ${Local_SRCS})
>
> Thanks for the help.
> _______________________________________________
> 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://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list