[Insight-users] ITK 4.0: building ItkVtkGlue fails due to incorrect setting of WRAP_ITK_INSTALL_PREFIX

Charl Botha c.p.botha at tudelft.nl
Mon Jan 30 12:36:43 EST 2012


On Mon, Jan 30, 2012 at 18:03, Charl Botha <c.p.botha at tudelft.nl> wrote:
> However, now I'd like to build Wrapping/ExternalProjects/ItkVtkGlue,
> but this is failing due to the WrapITKConfig.cmake being located in
> "Insight/lib/cmake/ITK-4.0/WrapITK/;CACHE;INTERNAL;PATH;subpath where
> where most of WrapITK files will be installed" -- it looks like
> WRAP_ITK_INSTALL_PREFIX has not been set correctly.

Some more info:

In Insight/Wrapping/WrapITKConfig.cmake.in we have:

IF("${WrapITK_DIR}" MATCHES "^${CMAKE_INSTALL_PREFIX}")
  STRING(REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}/*" "" prefix "${WrapITK_DIR}")
  SET(WRAP_ITK_INSTALL_PREFIX "${prefix}" CACHE PATH "subpath where
where most of WrapITK files will be installed")
ELSE("${WrapITK_DIR}" MATCHES "^${CMAKE_INSTALL_PREFIX}")
  MESSAGE("Warning: the CMAKE_INSTALL_PREFIX doesn't match the WrapITK
one. Your installation may not be usable.")
  SET(WRAP_ITK_INSTALL_PREFIX "@WRAP_ITK_INSTALL_PREFIX@" CACHE PATH
"subpath where where most of WrapITK files will be installed")
ENDIF("${WrapITK_DIR}" MATCHES "^${CMAKE_INSTALL_PREFIX}")

That second clause seems to be causing the problem, because in
Insight-build/Wrapping/WrapITKConfig.cmake it becomes:

ELSE("${WrapITK_DIR}" MATCHES "^${CMAKE_INSTALL_PREFIX}")
  MESSAGE("Warning: the CMAKE_INSTALL_PREFIX doesn't match the WrapITK
one. Your installation may not be usable.")
  SET(WRAP_ITK_INSTALL_PREFIX
"lib/cmake/ITK-4.0/WrapITK/;CACHE;INTERNAL;PATH;subpath where where
most of WrapITK files will be installed" CACHE PATH "subpath where
where most of WrapITK files will be installed")
ENDIF("${WrapITK_DIR}" MATCHES "^${CMAKE_INSTALL_PREFIX}")

(note the concatenation of keywords into one long value string)

I'm building the whole thing as per the instructions on
http://www.vtk.org/Wiki/ITK/Release_4/Wrapping/WrapITK_Installation --
this means that CMAKE_INSTALL_PREFIX is the ITK install prefix, and
that WrapITK_DIR by definition has to be that +Wrapping, which means
I'll always strike the second clause in the conditional above. I hope
that I'm missing something here.

Any tips would be much appreciated!


More information about the Insight-users mailing list