[Insight-users] how to modify FindITK.cmake for an unconventional install path?

Darren Weber darren.weber.lists at gmail.com
Wed May 27 16:44:08 EDT 2009


In MacPorts, a FindITK.cmake module is located in
/opt/local/share/cmake-2.6/Modules/FindITK.cmake

The ITK 3.12.0 port will be installed to (or similar version specific
locations):
/opt/local/lib/InsightToolkit-3.12
/opt/local/include/InsightToolkit-3.12
With symlinks:
/opt/local/lib/InsightToolkit -> InsightToolkit-3.12
/opt/local/include/InsightToolkit -> InsightToolkit-3.12

For any project, like itkHelloWorld, we can add the following to the
CMakeLists.txt file:
SET (ITK_DIR /opt/local/lib/InsightToolkit-3.12)

However, some unsuspecting software port might not be so lucky, so it should
be easy to tweak the FindITK.cmake module for this (in case some other ports
rely on it).  What is the most effective way to tweak the module so it will
find this unconventional ITK installation?  Is it enough to add or replace
unix paths in FindITK.cmake?  For example,

     52     # Look in standard UNIX install locations.
            /opt/local/lib/InsightToolkit-3.12
     53     /usr/local/lib/InsightToolkit
     54     /usr/lib/InsightToolkit

If that were done, what is the path precedence?  Imagine there is a custom
installation in /usr/local/lib/InsightToolkit, but the MacPorts library
should take precedence over that for any other MacPorts installations that
depend on ITK 3.12.

Take care,
Darren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090527/fd7dbfdd/attachment.htm>


More information about the Insight-users mailing list