[Debian-med-packaging] fixing bug FTBS bug#787753 (cmake cannot find itk)

Emmanuel Promayon Emmanuel.Promayon at imag.fr
Mon Jun 15 16:33:18 UTC 2015


Dear all,

I just committed the changes on the svn in order to fix the RC 
bug#787753 (and various lintian warnings).

 From what I can get, the new cmake version (>=3.1), has removed the 
FindITK.cmake file (insight toolkit library cmake configuration file) 
from its configuration database [1][2]. It means that any package that 
depends on ITK, might face the same problem in the next rebuild from source.

So just for future reference and help other debian-med packager, if:
a) the package build without any problem using cmake 3.0
b) the package depends on ITK (libinsighttoolkit3)
c) using unstable or cmake >= 3.1, this error occurs:

   By not providing "FindITK.cmake" in CMAKE_MODULE_PATH this project has
   asked CMake to find a package configuration file provided by "ITK", but
   CMake did not find one.

   Could not find a package configuration file provided by "ITK" with any of
   the following names:

     ITKConfig.cmake
     itk-config.cmake

   Add the installation prefix of "ITK" to CMAKE_PREFIX_PATH or set 
"ITK_DIR"
   to a directory containing one of the above files.  If "ITK" provides a
   separate development package or SDK, be sure it has been installed.

This might be the case for example for gofigure2, itksnap, vmtk...

There is a way (so far the only way I found) to fix this bug.
Just add a PATHS directive to the find_package in order to tell cmake 
where to look for the ITKConfig.cmake:
-            find_package(ITK REQUIRED)
+            find_package(ITK REQUIRED PATHS /usr/lib/InsightToolkit)

It might not be very clean, but it works.

This problem might also come from the fact that the library is called 
ITK but the lib directory where it is installed is called InsightToolkit 
(if it was called /usr/lib/ITK cmake might have been able to find it 
automatically, at least it is what I understood from [3]).

I don't know if that could be considered as a "bug" for the cmake 
package. If some of you think that way, let me know and I will file a bug.

Now back to the camitk package: everything seems to be ok, it does not 
FTBS anymore, and the lintian beast seems happy. The changes are 
commited on the svn.
I am therefore looking for a nice sponsor to consider uploading it!

Hope this help and thanks in advance if uploading is possible!
Best regards,
EP

[1] http://www.cmake.org/cmake/help/v3.2/module/FindITK.html
[2] http://www.cmake.org/cmake/help/v3.2/release/3.1.html
[3] http://www.cmake.org/cmake/help/v3.2/command/find_package.html




-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2947 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.alioth.debian.org/pipermail/debian-med-packaging/attachments/20150615/988b54af/attachment.bin>


More information about the Debian-med-packaging mailing list