WrapITK file installation location

Hi everyone,

I am porting an external project that use ITKWrap to wrap its own itk-based modules to ITK 5 and I’ve some issue with the location of Wrapping scripts. The initial script was:

find_package(WrapITK REQUIRED)

My problem is that cmake cannot find the macro itk_wrap_module. It is somewhat logical as it is nowhere in my ITK install hierarchy (Build with ITK_WRAPPING=ON). I would expect this files to be installed in ${ITK_INSTALL_PREFIX}/lib/cmake/ITK-5.0/WrapITK or something like this.

I feel like I’m missing something obvious!

My configuration is: Ubuntu 16.04, ITK 5.0

Thanks a lot for your help

I think you need ITK build tree. The install tree doesn’t have all the things the build tree has. I guess wrapping code is one of them.

Thanks for your answer… The issue I have is even once you get path to the wrapping directory in your project (let’s say WRAP_ITK_CMAKE_DIR = ${ITK_SRC_DIR}/Wrapping), it not quite enough. You need to include the main configuration file:

include (${WRAP_ITK_CMAKE_DIR}/ConfigureWrapping.cmake)

Then, this file add the generators subdirectory with CMake scripts that depends on macro in ITK source directory (${ITK_SRC_DIR}/cmake/itkTargetLinkLibrariesWithDynamicLookup.cmake). Thus, you need to point to this directory as well to be to include it.

All of this made me think I was missing something obvious… In ITK v5.0.0rc2 there was a WrapITKConfig.cmake.in that disappeared in ITK v5.0.0…


@matt.mccormick should be able to answer this question better than me, and possibly @blowekamp.

WrapITK was integrated into ITK in version 4.0, and it has enjoyed significant improvements since then.

A good overview of wrapping configuration can be found in the ITK Software Guide, Book 1, Section 9.5 “Wrapping”.