[Insight-developers] FindITK.cmake issues

Mark Foskey mark_foskey@unc.edu
Thu, 17 Oct 2002 11:00:56 -0400


Thanks, Brad (and Luis) for the help on the CMakeLists.txt file.  This 
is an overlapping issue.

As far as I can tell, cmake applies FindITK.cmake this way:

1. It tries to find one of the directories listed in FindITK.cmake.

2. If it fails, then it leaves the cache entry as NOTFOUND and and 
returns, after which the user typically modifies the cache via ccmake or 
CMake-Install.

3. If it finds one of those directories, then it assumes that the first 
one on its list that it finds is the bin dir and puts it in the cache.

4. It then searches that directory for ITKConfig.cmake, and reports an 
error message if it fails.

In our lab, the convention is to call the Insight source tree Insight, 
and call the bin tree Insight-Linux, Insight-VC++, or whatever.  So, in 
my home directory, I had Insight and Insight-Linux, and I got an error 
message from cmake.  Wanting to arrange things so I wouldn't have to 
always manually find the bindir, I looked at FindITK.cmake and saw that 
~/Insight-Linux wasn't a listed directory, so I renamed it to ~/itkbin, 
which was listed.  But then I still got the same error.  I finally tried 
renaming Insight to InsightSrc, and it worked.

As I think about this, I see that it makes sense to assume that 
'Insight' may be the name of the binary dir, since people not doing ITK 
development are less likely to do out-of-source bilds.  But should we 
suggest that people doing oos builds use 'InsightSrc' for their source dir?

Also, is it hard to have ccmake try a different directory on its list if 
it can't find what it needs there?  I'm guessing it is, actually, but I 
thought I'd mention it anyway.

Finally, it strikes me that there seems to be no provision for a global 
installation of ITK.  All of the paths to be searched seemed to be 
relative to the current dir or to the user's home dir.  This is odd, 
because Brad is working on build targets for an ITK "make install".  Am 
I missing something?

Thanks for any, um, insight.

-- 
Mark Foskey    (919) 843-5436   Computer-Aided Diagnosis and Display Lab
mark_foskey@unc.edu             Department of Radiology, CB 7515, UNC
http://www.cs.unc.edu/~foskey   Chapel Hill, NC  27599-7515