Build Error MITK 2016.11: ITK targets not defined

Hello,

as Dzenan suggests in the mailing list, i write my question here to possibly get more attention or answers :slight_smile:

Original post on mailing list:

Hello,

I tried to build MITK (v2016.11) from source with external VTK (v8.1.0)
and external ITK (v4.13.0) on Windows 10 with MVSC 15 2017 Win64. ITK,
VTK and Qt is built with the same compiler (and so on) and works fine
running standalone.

Additionaly i added the paths to the .dll’s to the Windows system path before.

So, the MITK build went fine (except for a few warnings) until it
searches for ITK (i suppose it doesnt reached VTK settings); it shows
following error:

CMake Error at
C:/VisLibs/ITK4/InsightToolkit-4.13.0-build/ITKTargets.cmake:37 (message):
Some (but not all) targets in this export set were already defined.
Targets Defined:
gdcmCommon; gdcmDICT; gdcmDSED; gdcmIOD; gdcmMEXD; gdcmMSFF;
gdcmcharls; gdcmjpeg12; gdcmjpeg16; gdcmjpeg8; hdf5-static; hdf5_cpp-static

Targets not yet defined:
itkdouble-conversion; itksys; itkvcl; itkv3p_netlib; itktestlib;
itkvnl; itkvnl_algo; itknetlib; ITKVNLInstantiation; ITKCommon;
itkNetlibSlatec; ITKStatistics; ITKTransform; ITKLabelMap; ITKMesh;
itkzlib; ITKMetaIO; ITKSpatialObjects; ITKPath; ITKQuadEdgeMesh;
ITKIOImageBase; ITKOptimizers; ITKPolynomials; ITKBiasCorrection;
ITKBioCell; ITKDICOMParser; ITKEXPAT; ITKIOXML; ITKIOSpatialObjects;
ITKFEM; itkgdcmopenjp2; gdcmsocketxx; ITKznz; ITKniftiio; ITKgiftiio;
GTest::GTest; GTest::Main; ITKIOBMP; ITKIOBioRad; ITKIOBruker; ITKIOCSV;
ITKIOGDCM; ITKIOIPL; ITKIOGE; ITKIOGIPL; ITKIOHDF5; itkjpeg; ITKIOJPEG;
itktiff; ITKIOTIFF; ITKIOLSM; itkminc2 //[… and so on]

Call Stack (most recent call first):
C:/VisLibs/ITK4/InsightToolkit-4.13.0-build/ITKConfig.cmake:64 (include)
CMakeLists.txt:758 (find_package)

– Configuring incomplete, errors occurred!
See also
“C:/VisLibs/MITK2016/MITK-build/MITK-build/CMakeFiles/CMakeOutput.log”.
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(171,5):
error MSB6006: “cmd.exe” exited with code 1.
Done building project “MITK-Configure.vcxproj” – FAILED.

So, somehow it cannot include all the ITK libraries. Path to
ITKConfig.cmake is well set as i see. Any ideas how to solve this? Is
this a problem related to the CMake files of MITK or should i apply some
additional configuration to the ITK build?

Thanks
Norbert

Hello Norbert,

A few things to try:

  • Make sure the ITK build completed successfully (so the targets exist)
  • Use a shorter path for the ITK and VTK build tree. Visual Studio has path length issues.
  • Check in with the MITK folks.

HTH,
Matt

Hey Matt,

thanks for your quick response!

  • ITK build completed successfully

Use a shorter path for the ITK and VTK build tree. Visual Studio has path length issues.

  • well, in my opinion its short :smiley: also building & running the ITK Hello World works

Check in with the MITK folks.

Well, they’re not as quick as you are. I just want to make sure that i do not have to make an extra build configuration for ITK when using it with MITK.

1 Like

Were you able to figure out this issue?
I am having a similar problem with gdcm.

I think the solution might be:

http://itk-users.7.n7.nabble.com/ITK-users-Problem-using-CMAKE-including-ITK-VTK-and-GDCM-td38933.html

or in my case i needed to specify the gdcm directory in the cmake files