[vtk-developers] Building VTK with QT5.4 Windows 8

Lonni Besançon lonni.besancon at gmail.com
Wed Jun 24 06:58:15 EDT 2015


To be more precise about my previous post (sorry I did not have the windows
computer nearby when I answered), when trying to use the example from the
Wiki: RenderWindowNoUiFile I get the error in /Cmake:
CMake Error at C:/Program Files
(x86)/CMake/share/cmake-3.2/Modules/FindQt4.cmake:1326 (message):
  Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
Call Stack (most recent call first):
  CMakeLists.txt:18 (find_package)
/
Which is completely logical since I don't have QT4 installed. 

Yet if I take a look at the CMakeList.txt it doesn't make sense as the
CMakeList contains:
/
cmake_minimum_required(VERSION 2.8)
 
if(POLICY CMP0020)
  cmake_policy(SET CMP0020 NEW)
endif()

PROJECT(RenderWindowNoUiFile)

find_package(VTK REQUIRED)
include(${VTK_USE_FILE})

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)
  find_package(Qt5Widgets REQUIRED QUIET)
else()
  find_package(Qt4 REQUIRED)
  include(${QT_USE_FILE})
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})

file(GLOB UI_FILES *.ui)
file(GLOB QT_WRAP *.h)
file(GLOB CXX_FILES *.cxx)

if(${VTK_VERSION} VERSION_GREATER "6" AND VTK_QT_VERSION VERSION_GREATER
"4")
  qt5_wrap_ui(UISrcs ${UI_FILES} )
  # CMAKE_AUTOMOC in ON so the MocHdrs will be automatically wrapped.
  add_executable(RenderWindowNoUiFile MACOSX_BUNDLE
    ${CXX_FILES} ${UISrcs} ${QT_WRAP})
  qt5_use_modules(RenderWindowNoUiFile Core Gui)
  target_link_libraries(RenderWindowNoUiFile ${VTK_LIBRARIES})
else()
  QT4_WRAP_UI(UISrcs ${UI_FILES})
  QT4_WRAP_CPP(MOCSrcs ${QT_WRAP})
  add_executable(RenderWindowNoUiFile MACOSX_BUNDLE ${CXX_FILES} ${UISrcs}
${MOCSrcs})

  if(VTK_LIBRARIES)
    if(${VTK_VERSION} VERSION_LESS "6")
      target_link_libraries(RenderWindowNoUiFile ${VTK_LIBRARIES} QVTK)
    else()
      target_link_libraries(RenderWindowNoUiFile ${VTK_LIBRARIES})
    endif()
  else()
    target_link_libraries(RenderWindowNoUiFile vtkHybrid QVTK vtkViews
${QT_LIBRARIES})
  endif()
endif()

/



--
View this message in context: http://vtk.1045678.n5.nabble.com/Building-VTK-with-QT5-4-Windows-8-tp5732403p5732515.html
Sent from the VTK - Dev mailing list archive at Nabble.com.


More information about the vtk-developers mailing list