[Insight-users] Using ITK externally

Neil Killeen Neil.Killeen@atnf.csiro.au
Tue, 17 Dec 2002 17:37:06 +1100 (EST)


Brad

just returning to the configuration of itk et al in external projects.


There seem to be multiple ways to configure an external project.


There exists

1)  Files such as

/usr/local/share/CMake/Modules/Find*

E.g.  FindVTK.cmake and FindITK.cmake
Using FindITK.cmake  is the recommended approach in InsightStart.pdf

But how can one be sure it finds the correct version (install, local
build etc) ?


2) The file

/usr/local/lib/InsightToolkit/ITKConfig.cmake

however there is no equivalent file for VTK that I could find.



3) The files

/usr/local/lib/InsightToolkit/UseITK.cmake

and

/usr/local/include/vtk/UseVTK.cmake


(note one in 'lib', the other in 'include' !)


My understanding (such as it is...) presently is that these are a rough
hierarchy in the order listed.   The 'Use*' files actually invoke cmake commands
like LINK_LIBRARIES and LINK_DIRECTORIES.

I wanted to set these variables myself at the appropriate level
in my directory hiearchy (e.g. for applications only) so I thought
I should avoid the Use files.  However, since there is no VTKConfig.cmake
I had no choice but to use 1) or 3).

Then one never quite knows what variables are being defined for you
and what not and what the dependencies are.  For example,
ITKConfig.cmake defines for you  the variable

ITK_LIBRARY_DIRS

(and this IS documented in the ITKCOnfig.cmake file itself which is fine)

but invoking UseVTK.cmake does not give me any such thing
(VTK_LIBRARY_DIRS that is)


What I would find really valuable would be

. something that describes the various cmake configuration files, what
  they are intended for and their correct uses and dependencies.

. how each package (itk/vtk)  is using the above if there is variation
  from the standard.  Clearly vtk is using them differently from itk...

So this is some mixture of cmake and package docs i suppose.
Perhaps I should post this to all the exploders :-(



cheers
Neil