# Building VTK with Qt support - VTK looks in the wrong place for qmlplugindump

**URL:** <https://discourse.vtk.org/t/building-vtk-with-qt-support-vtk-looks-in-the-wrong-place-for-qmlplugindump/6325>\
**Category:** Development\
**Created:** [August 8, 2021, 9:17am UTC](https://discourse.vtk.org/t/building-vtk-with-qt-support-vtk-looks-in-the-wrong-place-for-qmlplugindump/6325 "2021-08-08T09:17:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbaleksandar](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rbaleksandar/32/3754_2.png) [@rbaleksandar](https://discourse.vtk.org/u/rbaleksandar)\
**Post date:** [August 8, 2021, 9:17am UTC](https://discourse.vtk.org/t/building-vtk-with-qt-support-vtk-looks-in-the-wrong-place-for-qmlplugindump/6325/1 "2021-08-08T09:17:27Z")

</div>

I have installed Qt 5.15 via the official installer and not the package manager of my Xubuntu 20.04. According to cmake all the required cmake variables are set (Qt5\_DIR, Qt5Core\_DIR etc.).

The build goes without any issues up to the point when `qmlplugindump` is requested:

```auto
[100%] Built target qmlvtkplugin_autogen
[100%] Linking CXX shared module ../../../lib/qml/VTK.9.0/libqmlvtkplugind.so
Generating qmltypes file using qmlplugindump
/bin/sh: 1: /usr/bin/qmlplugindump: not found
make[2]: *** [GUISupport/QtQuick/qml/CMakeFiles/qmlvtkplugin.dir/build.make:136: lib/qml/VTK.9.0/libqmlvtkplugind.so] Error 127
make[2]: *** Deleting file 'lib/qml/VTK.9.0/libqmlvtkplugind.so'
make[1]: *** [CMakeFiles/Makefile2:17327: GUISupport/QtQuick/qml/CMakeFiles/qmlvtkplugin.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

```

At first I got scared since I did have a previous Qt 5 installation (via the package manager) that I needed for QGIS. However `nm` gave me a piece of mind:

```auto
:~/BUILDS/VTK/build$ nm lib/libvtkViewsQt-9.0.so | grep 5.15
                 U qt_version_tag@@Qt_5.15

```

This means that the linking is done correctly however for some reason the building process attempts to execute `qmlplugindump` from the wrong path. The only `qmlplugindump` I have is in `/opt/Qt/5.15.2/gcc_64/bin`, which is also part of the Qt that I am using for the whole build.

Since I’m not familiar with VTK I’m reaching out to you hoping to resolve this. If it is an error in my environment - perfect. However if it is not, this would mean that the VTK build process is broken, when it comes to the Qt integration. This is why I tagged it as Development and not Support.

---

<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:** [August 8, 2021, 3:18pm UTC](https://discourse.vtk.org/t/building-vtk-with-qt-support-vtk-looks-in-the-wrong-place-for-qmlplugindump/6325/2 "2021-08-08T15:18:40Z")

</div>

The location is attempted based on QtCore’s location, but we do `find_program`, so there is the `QMLPLUGINDUMP_EXECUTABLE` cache variable to select something new. You might need to remove the value from the cache to have it search again, but I’d guess you have a stale location from when you might have had a Qt5 there.

---

<div class="post-metadata">

**Author:** ![rbaleksandar](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rbaleksandar/32/3754_2.png) [@rbaleksandar](https://discourse.vtk.org/u/rbaleksandar)\
**Post date:** [August 8, 2021, 6:09pm UTC](https://discourse.vtk.org/t/building-vtk-with-qt-support-vtk-looks-in-the-wrong-place-for-qmlplugindump/6325/3 "2021-08-08T18:09:42Z")

</div>

Yes, I found it and it works. However I don’t understand why it is not retrieved properly. I guess the issue here is the separation between libs and executables on a standard Linux installation. If you install Qt using the official installer normally it packs everything together in a folder. There is still a separation but the root folder is enough to deduce where each component is located.

---

<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:** [August 8, 2021, 7:37pm UTC](https://discourse.vtk.org/t/building-vtk-with-qt-support-vtk-looks-in-the-wrong-place-for-qmlplugindump/6325/4 "2021-08-08T19:37:09Z")

</div>

AFAIK, Qt doesn’t give us a target to use and we have to find it ourselves. Hence the `HINTS` we pass based on the `Qt5::Core` target’s location. But, that’s only a guess and we are prone to finding a wrong one.
