# cmake error with vtkModule.cmake

**URL:** https://discourse.vtk.org/t/cmake-error-with-vtkmodule-cmake/13704
**Category:** Support
**Created:** [April 12, 2024, 5:56pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtkmodule-cmake/13704 "2024-04-12T17:56:57Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Dean](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/3be4f8/32.png) [@Dean](https://discourse.vtk.org/u/Dean)
#### Post date: [April 12, 2024, 5:56pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtkmodule-cmake/13704/1 "2024-04-12T17:56:57Z")

</div>

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 .

---

<div class="post-metadata">

### Author: ![Dean](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/3be4f8/32.png) [@Dean](https://discourse.vtk.org/u/Dean)
#### Post date: [April 12, 2024, 6:26pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtkmodule-cmake/13704/2 "2024-04-12T18:26:12Z")

</div>

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)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [April 13, 2024, 12:32pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtkmodule-cmake/13704/3 "2024-04-13T12:32:08Z")

</div>

> [@Dean](#):
>
> building gdcm

What is that ?

---

<div class="post-metadata">

### Author: ![Dean](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/3be4f8/32.png) [@Dean](https://discourse.vtk.org/u/Dean)
#### Post date: [April 13, 2024, 12:50pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtkmodule-cmake/13704/4 "2024-04-13T12:50:33Z")

</div>

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](https://dgobbi.github.io/vtk-dicom/)) which uses it for reading compressed dicom image content. No need to consider this as an issue.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [April 27, 2024, 7:01pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtkmodule-cmake/13704/5 "2024-04-27T19:01:19Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Dean](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/3be4f8/32.png) [@Dean](https://discourse.vtk.org/u/Dean)
#### Post date: [April 27, 2024, 8:30pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtkmodule-cmake/13704/6 "2024-04-27T20:30:51Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![gladk](https://discourse.vtk.org/user_avatar/discourse.vtk.org/gladk/32/8965_2.png) [@gladk](https://discourse.vtk.org/u/gladk)
#### Post date: [June 15, 2024, 9:33am UTC](https://discourse.vtk.org/t/cmake-error-with-vtkmodule-cmake/13704/7 "2024-06-15T09:33:39Z")

</div>

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](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072822)  
Logs: [Build log for gdcm (3.0.24-1+b2) on amd64](https://buildd.debian.org/status/fetch.php?pkg=gdcm&arch=amd64&ver=3.0.24-1%2Bb2&stamp=1717845766&raw=0)

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

Thank you

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [June 16, 2024, 1:30pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtkmodule-cmake/13704/8 "2024-06-16T13:30:57Z")

</div>

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

---

<div class="post-metadata">

### Author: ![gladk](https://discourse.vtk.org/user_avatar/discourse.vtk.org/gladk/32/8965_2.png) [@gladk](https://discourse.vtk.org/u/gladk)
#### Post date: [June 16, 2024, 1:42pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtkmodule-cmake/13704/9 "2024-06-16T13:42:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![gladk](https://discourse.vtk.org/user_avatar/discourse.vtk.org/gladk/32/8965_2.png) [@gladk](https://discourse.vtk.org/u/gladk)
#### Post date: [June 18, 2024, 7:33pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtkmodule-cmake/13704/10 "2024-06-18T19:33:39Z")

</div>

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

> **[d/patches: gdcm FTBFS with VTK 9.3.0. Closes: #1072822 (f923088d) · Commits ·...](https://salsa.debian.org/med-team/gdcm/-/commit/f923088d30f69598e1476f4fe7139e64b41ec8f2)**
>
> Debian packaging for gdcm

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [June 19, 2024, 12:07pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtkmodule-cmake/13704/11 "2024-06-19T12:07:15Z")

</div>

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