[Insight-users] Using ITK externally

Neil Killeen Neil.Killeen@atnf.csiro.au
Mon, 16 Dec 2002 13:58:25 +1100 (EST)


Brad

On Thu, 12 Dec 2002, Brad King wrote:

> >   However, I installed these files by copying them from where
> >   the ITK install process
> >
> > % make install
>
> This is the proper way to install it.  Set ITK's CMAKE_INSTALL_PREFIX
> cache entry to the prefix you want to use.  If you are trying to install
> ITK, don't turn on the VTK-specific features (or tell it where to find
> VTK).  These features are only for testing, and are not part of the
> install anyway.  This should give you control over CMAKE_INSTALL_PREFIX
> for ITK.  The reason the VTK one is forced upon ITK is because of a bug in
> VTK's UseVTK.cmake file.  It has been fixed in the CVS version of VTK.
>

ok; on eradicating VTK (which I included as my own project will use
both itk and vtk), indeed I got control over the install path. so that
worked ok now.

I found after doing this, that some of the Examples no longer
linked as they were missing X11 in the link list.  MetaImageViewer for
example, I think (does not use VTK).

It seems as there is some mis-configuration when VTK is not included
but Tcl is, such that X11 is not linked in.

I was not able to divine where X11 was added in the process, despite
a lot of poking about.    When I added X11 by hand, they linked OK.




>
> Read Insight/Documentation/InsightStart.pdf from the source tree.  It
> includes information on how to use ITK from your project.  Here is a quick
> start if you don't want to use FindITK.cmake:
>

I did (squeaky voice) !   OK, now that I know that the config file
lives in the installed library path, I can understand the process now
and I have managed to link an application in my own project tree
with ITK.  Yay me.

----


I have a couple of philosphical questions about the organization of the
building process

The way ITK is set up with cmake, you do

. install code
. create binary location directory
. run cmake from the binary tree

That is, you position yourself in the binary tree to build modules and
applications.    I  have copied this style for my own project.

1) I would usually choose to arrange things so that I position myself
  in the *code* tree when building modules or applications.  The system
  should know what platform I am using (it can figure it out) and set the
  build location appropriately and send the output there.  In this way, I
  don't have to hop from code location to build location as I build code.

  Is it something to do with the cross-platform nature of cmake that
  pushed the design in the other direction ?   Can cmake be used the other
  way around ?

2) When I change a piece of the source tree (e.g. add a new module,
   or decide I need a new link list etc) I must regenerate the entire
   binary tree set of makefiles ('g' in cmake).    Is there a way to ask
   the system to just regenerate a piece of the tree ?   It might be rather time
   consuming  to do the former for large projects.   Again, this comes
   down to the philosophy alluded to in 1) above, I think.



thanks for your (plural) continued help

cheers
Neil