1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
To use tcl or python wrapping using cswig, you will have to build
CableSwig. CableSwig is a combination package that includes swig,
cable, and gccxml. When built CableSwig will have three execuables:
cswig - the main cable swig executable, that takes an xml file from
gccxml as input. The xml file should be created from a cable config
input file.
cableidx - a program to generate index files from gccxml xml files. The
index files tell cswig what classes are wrapped in which libraries.
gccxml_cc1plus - A patched version of gcc that has the -fxml option to
convert c++ into xml.
gccxml - http://www.gccxml.org/HTML/Index.html, the front end program to gccxml_cc1plus
To build ITK with the CSwig wrappers:
1. checkout a copy of CableSwig
Simply do:
cvs -d:pserver:anonymous@public.kitware.com:/cvsroot/CableSwig co CableSwig
Note that no cvs login is needed here.
1.1 IF you checkout CableSwig in the Insight/Utilities directory, then
CableSwig will be built as part of ITK
2. build CableSwig on your system. (this step can be skipped if 1.1 was done.
3. run cmake on ITK (ccmake or CMakeSetup)
- turn on the show advanced values option (t in ccmake)
- Turn on ITK_CSWIG_TCL and/or ITK_CSWIG_PYTHON
- run cmake configure (c for ccmake, Configure button for CMakeSetup)
- if not found already, Set the cache entry for CSWIG to the full path to the
cswig executable built in 1. Run cmake configure again.
Cmake should set CABLE_INDEX and GCCXML based on the path given for CSWIG.
When running on windows, as long as CableSwig was configured first, cmake
should automatically find all of them. If step 1.1 was followed, then
CSWIG, CABLE_INDEX, and GCCXML should all be set automatically.
- generate the makefiles
To run scripts.
To make things easier to use, you have to set paths to the build tree of ITK.
If using msdev or devenv, you have to include the config directory
(Release,Debug,MinSizeRel, RelWithDebInfo).
Python:
- set the PYTHONPATH variable to ITK-build/Wrapping/CSwig/Python/[Release].
- run python and run this python command:
from InsightToolkit import *
Tcl:
- set the TCLLIBPATH variable to ITK-build/Wrapping/CSwig/Tcl/[Release|Debug]
Use the following at the top of the script:
package require Tk
package require InsightToolkit
package require itkinteraction
Java:
- set CLASSPATH to include ITK-build/Wrapping/CSwig/Java/InsightToolkit.jar
There are a few examples in Insight/Wrapping/CSwig/Tests.
KNOWN ISSUES:
- dependency information is not available in visual studio until
after the first build, and cmake is run again.
- Python must be built Release of RelWithDebInfo on windows.
- Java on Linux requires at least the JDK version 1.4.2_04.
|