[Insight-users] CMakeLists question

Gavin Baker gavinb+xtk at cs.mu.OZ.AU
Tue, 30 Mar 2004 09:27:25 +1000


Hi Silviu,

On Sun, Mar 28, 2004 at 03:56:54PM -0500, Silviu D Minut wrote:

> > > This is ok, but it's getting tiresome. I do have ITK installed, and it
> > > won't change its location any time soon.  I don't mind cmake searching
> > > for ITK (I assume the FIND also sets some variables too), but I don't
> > > want to enter the path every time. How do I tell cmake beforehand what
> > > ITK_DIR should be?
[...]
> Of course, for a given project. But I'm going to have many small projects,
> to begin with.

Provided ITK is installed in one of the canonical locations, CMake should
find it automagically anyway.  It is only when it is located in a
non-standard place that you need to specify ITK_DIR manually.  By default,
the FIND_PACKAGE(ITK) will look in:

    /usr/local/lib/InsightToolkit
    /usr/lib/InsightToolkit

(or on a Windows box it should check the registry for a record of the
install location.)

If you don't and/or can't install it in one of these places, you can always
"prime" CMake by specifying the location in the CMakeCache.txt file (in the
root of your build tree).  Simply create a text file with a line like this:

ITK_DIR:PATH=/home/sdm/projects/lib/InsightToolkit

Then you can copy this cache file into new projects before you run CMake and
it will simply pick up the setting, just like you want.

  :: Gavin

-- 
Gavin Baker                                      Complex Systems Group
http://www.cs.mu.oz.au/~gavinb             The University of Melbourne