VTK 8.90 missing vtkGUISupportQt_LOADED

I am building VTKExamples standalone and I have noticed that I am getting the message: “VTKWikiExamples: Not building Qt examples”

There is no variable vtkGUISupportQt_LOADED being set in the VTK build.
I changed VTK_GROUP_ENABLE_QT:WANT to VTK_GROUP_ENABLE_QT:YES and got the same result.

Has there been a name change for vtkGUISupportQt_LOADED?

Cc: @ben.boeckel @lorensen

Andrew,

I think you need something like:

if (TARGET GUISupportQt)

Bill

Andrew,

I updated the top level CMakeLists.txt file. I can’t get a clean Qt
build for VTK under the new module system. Can you see if this fixes
the qt issue?

Thanks,

Bill

@bill From what I can see there is no longer a VTK_QT_VERSION variable:

vtkGUISupportQt_LOADED: 
We have GUISupportQt
VTK_VERSION: 8.90.0
VTK_QT_VERSION: 
VTKWikiExamples: Building Qt examples
CMake Error at /usr/local/share/cmake-3.13/Modules/FindQt4.cmake:1313 (message):
  Found unsuitable Qt version "5.12.0" from
  /home/amaclean/Qt/5.12.0/gcc_64/bin/qmake, this code requires Qt 4.x
Call Stack (most recent call first):
  CMakeLists.txt:150 (find_package)

I also built VTK with VTK_GROUP_ENABLE_QT:WANT and VTK_GROUP_ENABLE_QT:YES, VTK_QT_VERSION remains empty.

In looking at VTK/Examples/GUI/Qt only Qt 5.x seems to be supported.

I don’t have Qt4 so I’m asking the question:

Does VTK 8.90 even build with Qt4?

If it doesn’t then I thought this would work in the top-level CMakeLists.txt file:

if(vtkGUISupportQt_LOADED OR TARGET VTK::GUISupportQt)
  message(STATUS "VTKWikiExamples: Building Qt examples")
  if (VTK_VERSION VERSION_LESS "8.90.0")
    if(${VTK_VERSION} VERSION_GREATER "6" AND VTK_QT_VERSION VERSION_GREATER "4")
      # Instruct CMake to run moc automatically when needed.
      set(CMAKE_AUTOMOC ON)
      # We have ui files, this will bring in the macro: qt5_wrap_ui
      find_package(Qt5Widgets REQUIRED QUIET)
    else()
      find_package(Qt4 REQUIRED)
      include(${QT_USE_FILE})
    endif()
  else()
     # Instruct CMake to run moc automatically when needed.
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTOUIC ON)
    find_package(Qt5Widgets REQUIRED QUIET)
  endif()
  add_subdirectory(src/Cxx/Qt)
else()
  message(STATUS "VTKWikiExamples: Not building Qt examples")
endif()
# Is git lfs installed?
file(READ "${WikiExamples_SOURCE_DIR}/src/Testing/Data/GitLfsInstalled" data)

However I get undefined reference tomain’` when building the Qt tests.

Let’s drop qt4 in the examples.

I agree, it’s pretty old.

I’m assuming you will modify the VTKExample CMake files. Let me know when done and I’ll test using vtk 8.90 and vtk 8.2.

I’ll rip out the qt4 stuff. I can’t test because I’m having trouble
building with qt on ubuntu and macos.

Bill

@lorensen , I downloaded SideBySideRenderWindowsQt and got it building with a few modifications on Kubuntu. Here is the modifiedCMakeLists.txt (2.4 KB) file that works for VTK 8.90 and VTK 8.2, I also removed the deprecation warnings when using VTK 8.90. Knowing you, you may have already done this :grinning:, however, if you haven’t, you may be able to create a template for the Qt files from this.

1 Like

Does VTK 8.90 even build with Qt4?

Qt4 support was removed prior to 8.2 (Nov 2017).

if (TARGET GUISupportQt)

This should be if (TARGET VTK::GUISupportQt). The unprefixed name is only valid in a build of VTK itself; the namespace version is available everywhere.

Great! I’ll fix it.