proper linking with MetaIO with metaTypes

I am updating a vtk based code work with the latest vtk. I am running into this issue.

[ 67%] Building CXX object VolumeProcessing/CMakeFiles/vtkVolumeProcessing.dir/vtkOOCMetaImageReader.cxx.o
In file included from /Users/sansomk/build/ACVD/ACVD/VolumeProcessing/vtkOOCMetaImageReader.cxx:27:
/Users/sansomk/build/VTK/install/include/vtk-9.0/vtkmetaio/metaTypes.h:12:10: fatal error: 
      'localMetaConfiguration.h' file not found
#include "localMetaConfiguration.h"

the top level CMakeLists.txt includes the metaio library via

find_package(VTK REQUIRED COMPONENTS 
            CommonCore
            CommonDataModel
            RenderingCore
            CommonSystem
            IOImport
            IOExport
            IOImage
            IOGeometry
            IOPLY
            FiltersSources
            InteractionStyle
            FiltersHybrid
            RenderingLabel
            IOMINC
            FiltersModeling
            FiltersGeneral
            metaio
)

the local CMakeLists.txt has

target_link_libraries(vtkVolumeProcessing ${VTK_LIBRARIES})

and I added

vtk_module_autoinit(
  TARGETS vtkVolumeProcessing
  MODULES ${VTK_LIBRARIES}
  )

which I thought was supposed to take care of the includes?

I am sure there is something simple I am missing but I am at a loss here.

Seems I missed installing that header. In the meantime, you can copy it from your source/build tree to the install tree manually.

https://gitlab.kitware.com/vtk/vtk/-/merge_requests/6716 will be in 9.0

Yay I found bug! thanks @ben.boeckel
Feels good to contribute.

MetaIO upstream (another Kitware team) had actually already fixed it, just needed to pull it into VTK :slight_smile: .

1 Like