CentOS: ITKConfig.cmake not found

I am using CentOS 7.6.1810 and have just installed itk and vtk using

sudo yum localinstall InsightToolkit-4.9.1-1.sdl6.i686.rpm

and

sudo yum localinstall vtk-6.1.0-5.sdl7.x86_64.rpm

respectively. Both ran to completion without any errors. I then installed cmake with

sudo yum install cmake

It also ran to completion without errors. I then made the following simple CMakeLists.txt file

project(ItkTest)

FIND_PACKAGE ( ITK )

When I entered

cmake CMakeLists.txt

I got the following error

CMake Warning at /usr/share/cmake/Modules/FindITK.cmake:48 (find_package):

  • Could not find a package configuration file named ā€œITKConfig.cmakeā€*
  • provided by package ā€œITKā€.*

sudo find / -name ITKConfig.cmake -print

returned no results.

It sounds like CentOSā€™s package is missing ITKConfig.cmake file. You could try to see if there is a newer package of ITK, or build ITK yourself.

Welcome to the ITK community, @OtagoHarbour! :sunny:

For CentOS, install the InsightToolkit-devel and InsightToolkit-vtk-devel (if available) packages to make the C++ headers and CMake build configuration files available. The InsightToolkit package only contains runtime libraries, etc.

2 Likes

Hi Matt,

Thank you very much for your reply. I downloaded, and installed, itk-devel-3.4-9.el7.x86_64.rpm using

sudo yum install itk-devel-3.4-9.el7.x86_64.rpm

Unfortunately,

sudo find / -name ITKConfig.cmake -print

returns no results.

I tried to find vtk-devel for CentOS. I found links but they only took me to more links. I was unable to find an rpm file to download. Eventually, I found that I was going in a circle.

Thanks,
OH

Hi Otago,

The

InsightToolkit-devel

versus

itk-devel

packages are required.

HTH,
Matt