[vtkusers] CMake and Add a Local directory of new classes?
Jean M. Favre
jfavre at cscs.ch
Fri Jan 17 09:09:08 EST 2003
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.
More information about the vtkusers
mailing list