Menu

#552 Problem compiling with VTK 9.3.0 support

3.0.25
closed
None
9
2024-06-18
2023-10-26
No

Hello everyone!

I'm desperately trying to compile GDCM with VTK support to use in my c++ code...

Version:
GDCM: 3.0.22
VTK: 9.3.0

For cmake configuration, I put:
GDCM_USE_VTK = YES
VTKGDCM_NAME = vtkgdcm
VTK_MODULE_ENABLE_GDCM_vtkgdcm = YES

During generation, I get the following error:

Building Utilities/VTK as a VTK 9 Module
CMake Error at /usr/local/lib/cmake/vtk-9.3/vtkModule.cmake:2121 (message):
The SPDX_DESTINATION must not be an absolute path. Use
CMAKE_INSTALL_PREFIX to keep everything in a single installation prefix.
Call Stack (most recent call first):
/usr/local/lib/cmake/vtk-9.3/vtkModule.cmake:2667 (_vtk_module_check_destinations)
CMakeLists.txt:694 (vtk_module_build)

I don't know if the problem is with VTK, but I've tried various build operations on VTK without success to solve the problem with GDCM.

Thanks in advance for your help

Discussion

  • Marius Schamschula

    I've also run into this problem under MacPorts: https://trac.macports.org/ticket/68835

     
  • nilason

    nilason - 2023-12-05

    With the following patch I succeded to build against VTK 9.3.0

    --- CMakeLists.txt.orig
    +++ CMakeLists.txt
    @@ -698,6 +698,7 @@
             HEADERS_DESTINATION   "${GDCM_INSTALL_INCLUDE_DIR}/vtk${vtk_version_suffix}"
             CMAKE_DESTINATION     "${GDCM_INSTALL_PACKAGE_DIR}"
             LICENSE_DESTINATION   "${GDCM_INSTALL_DATA_DIR}/vtkgdcm-${GDCM_SHORT_VERSION}"
    +        SPDX_DESTINATION      "${GDCM_INSTALL_DATA_DIR}/vtkgdcm-${GDCM_SHORT_VERSION}"
             HIERARCHY_DESTINATION "${GDCM_INSTALL_LIB_DIR}/vtk${vtk_version_suffix}/hierarchy/vtkgdcm"
             LIBRARY_NAME_SUFFIX   "${vtkgdcm_library_suffix}"
             VERSION               "${GDCM_VERSION}"
    
    
    --- Utilities/VTK/vtkImageColorViewer.h.orig
    +++ Utilities/VTK/vtkImageColorViewer.h
    @@ -199,22 +199,6 @@
       virtual int GetOffScreenRendering();
       vtkBooleanMacro(OffScreenRendering,int);
    
    -  // Description:
    -  // @deprecated Replaced by vtkImageColorViewer::GetSliceMin() as of VTK 5.0.
    -  VTK_LEGACY(int GetWholeZMin());
    -
    -  // Description:
    -  // @deprecated Replaced by vtkImageColorViewer::GetSliceMax() as of VTK 5.0.
    -  VTK_LEGACY(int GetWholeZMax());
    -
    -  // Description:
    -  // @deprecated Replaced by vtkImageColorViewer::GetSlice() as of VTK 5.0.
    -  VTK_LEGACY(int GetZSlice());
    -
    -  // Description:
    -  // @deprecated Replaced by vtkImageColorViewer::SetSlice() as of VTK 5.0.
    -  VTK_LEGACY(void SetZSlice(int));
    -
     protected:
       vtkImageColorViewer();
       ~vtkImageColorViewer();
    
    
    
    --- Utilities/VTK/vtkImageColorViewer.cxx.orig
    +++ Utilities/VTK/vtkImageColorViewer.cxx
    @@ -919,34 +919,6 @@
     }
    
     //----------------------------------------------------------------------------
    -#ifndef VTK_LEGACY_REMOVE
    -int vtkImageColorViewer::GetWholeZMin()
    -{
    -  VTK_LEGACY_REPLACED_BODY(vtkImageColorViewer::GetWholeZMin, "VTK 5.0",
    -                           vtkImageColorViewer::GetSliceMin);
    -  return this->GetSliceMin();
    -}
    -int vtkImageColorViewer::GetWholeZMax()
    -{
    -  VTK_LEGACY_REPLACED_BODY(vtkImageColorViewer::GetWholeZMax, "VTK 5.0",
    -                           vtkImageColorViewer::GetSliceMax);
    -  return this->GetSliceMax();
    -}
    -int vtkImageColorViewer::GetZSlice()
    -{
    -  VTK_LEGACY_REPLACED_BODY(vtkImageColorViewer::GetZSlice, "VTK 5.0",
    -                           vtkImageColorViewer::GetSlice);
    -  return this->GetSlice();
    -}
    -void vtkImageColorViewer::SetZSlice(int s)
    -{
    -  VTK_LEGACY_REPLACED_BODY(vtkImageColorViewer::SetZSlice, "VTK 5.0",
    -                           vtkImageColorViewer::SetSlice);
    -  this->SetSlice(s);
    -}
    -#endif
    -
    -//----------------------------------------------------------------------------
     void vtkImageColorViewer::PrintSelf(ostream& os, vtkIndent indent)
     {
       this->Superclass::PrintSelf(os, indent);
    
    
    
    --- Utilities/VTK/vtkGDCMTesting.cxx.orig
    +++ Utilities/VTK/vtkGDCMTesting.cxx
    @@ -14,7 +14,6 @@
     #include "vtkGDCMTesting.h"
    
     #include "vtkObjectFactory.h"
    -#include "vtkToolkits.h"
     #include "gdcmTesting.h"
     #include "gdcmFilename.h"
    
     
  • Mathieu Malaterre

    Fixed 3be6c2fa0945c91889bcf06e8c20e88f69692dd5

    thanks !

     
  • Mathieu Malaterre

    • status: open --> closed
    • assigned_to: Mathieu Malaterre
     
  • Mathieu Malaterre

    • Group: 3.1 --> 3.0.25
     

Log in to post a comment.