cmake error with vtkModule.cmake

building v9.3.0 static debug c++ Visual Studio 2022. My cmake install prefix is a relative path
from my build director “…/install” . vtk builds and installs . building gdcm I receive:
Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19043.
Building Utilities/VTK as a VTK 9 Module
CMake Error at D:/build/install/lib/cmake/vtk/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):
D:/build/install/lib/cmake/vtk/vtkModule.cmake:2667 (_vtk_module_check_destinations)
CMakeLists.txt:694 (vtk_module_build)

during configuration. Do I have to turn something in my vtk cmake cache on or off ?

I am developing a qt desktop app with Qt5 and require gdcm .

FWIW I get over the hurdle if I comment out the following in my installed vtkModule.cmake:

_vtk_module_check_destinations(vtk_build
ARCHIVE_DESTINATION
HEADERS_DESTINATION
RUNTIME_DESTINATION
CMAKE_DESTINATION
LICENSE_DESTINATION
#SPDX_DESTINATION <------------------------
HIERARCHY_DESTINATION)

What is that ?

GDCM (grass roots dicom library) = gdcm

I have found other issues with building gdcm that should be posted to gdcm forum. For now my solution is to not build gdcm with vtk 9.x dependency. I need gdcm for my build of the vtk-dicom (Home - dgobbi) which uses it for reading compressed dicom image content. No need to consider this as an issue.

It looks like CMAKE_INSTALL_DATAROOTDIR may be empty or set to an absolute path. Can you share the full configure line you used?

sorry, I removed that build and used ITK gdcm module to link to in my vtk-dicom build.
It would be great if there were coverage for Visual Studio based static builds of the
VTK/ITK/GDCM/vtk-doicom/CTK/Qt ecosystem.

Hi,

I am facing the same problem, fixing the gdcm package in the Debian.
gdcm worked fine with VTK_9.1, but does not work with 9.3.

As pointed earlier CMAKE_INSTALL_DATAROOTDIR is really empty. Should it be fixed in VTK?

Bug description: #1072822 - gdcm FTBFS with VTK 9.3.0 - Debian Bug report logs
Logs: Build log for gdcm (3.0.24-1+b2) on amd64

It would be nice to get a response to fix the build.

Thank you

Why is that variable empty though? Shouldn’t it always have at least a /share/ component to it?

I do not know, why it is empty. GDCM does not set this variable explicitly. So it looks like a regression.

Just for the note. The problem was resolved in the Debian Package of GDCM (and probably by upstream)

Is GDCM not using GNUInstallDirs? Perhaps we can ignore empty settings and just not install those components?